Results 1 to 3 of 3

Thread: Automatic texture coordinate generation

  1. #1
    Member Contributor
    Join Date
    Apr 2002
    Posts
    94

    Automatic texture coordinate generation

    The redbook says that glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR)will make the texture move with the object. (I do this for GL_T also).

    So I am wondering how opengl knows how the object has transformed? Does this mean that any glTranslate, glRotate, glScale commands I do AFTER I enable with glEnable(GL_TEXTURE_GEN_S) are treated as the object transforming until I glDisable(GL_TEXTURE_GEN_S) it again?

    In other words, where do I put this in the code so it doesn't affect everything else?

    Thanks!
    P4 2Ghz, GEFORCE4, 512 Meg RAM, WIN2000, VStudio 6.0

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Automatic texture coordinate generation

    OpenGL uses the vertex after modelview transformation to generate texture coordinates. Do your modelview transformations as usual, and enable texture coordinate generation when needed.

  3. #3
    Member Contributor
    Join Date
    Apr 2002
    Posts
    94

    Re: Automatic texture coordinate generation

    OK, I thought when I put GL_OBJECT_PLANE instead of GL_OBJECT_LINEAR, that meant that the plane was defined in world coordinates instead of the object's coordinates. I guess the plane is ALWAYS in local coordinates?

    So is this correct thinking then?...
    glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR) just tells opengl that I want to generate texture coordinates local to that object. And glTexGenfv(GL_S, GL_OBJECT_PLANE, plane) tells opengl that I want to use a plane which I specify.

    Thanks!
    P4 2Ghz, GEFORCE4, 512 Meg RAM, WIN2000, VStudio 6.0

Similar Threads

  1. Automatic Texture-coordinate Generation
    By Cuaitl in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 09-08-2008, 12:51 AM
  2. Automatic Texture Coordinate Generation in fragment Program
    By unreal in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 04-18-2005, 01:16 PM
  3. automatic texture-coordinate generation
    By gemelli_d in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-08-2004, 04:17 AM
  4. Automatic Coordinate Generation With Culling On?
    By Sephiroth in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-03-2002, 11:30 AM
  5. Automatic Texture-Coordinate Generation Problem
    By lsdi in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-03-2002, 10:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean