Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: glTexGen

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2002
    Location
    kremnica, slovakia, europe, earth, sol :-)
    Posts
    102

    glTexGen

    i need to compute texture coordinate using linear equation based on current modelview matrix multiplied by current vertex (something like GL_OBJECT_LINEAR but apply modelview matrix before)...

    simply i want to assign higher coordinate to vertex with higher z. that coordinate should be computed after transformation because my scene is build from variuos pieces, translated and rotated together.

    it could be possible to use GL_OBJECT_LINEAR and after each change of modelview matrix change texture matrix too... is this a good aproach or is there something better?

    [This message has been edited by miko (edited 03-06-2003).]

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2002
    Location
    Espoo, Finland
    Posts
    599

    Re: glTexGen

    Hi,

    You can use GL_EYE_LINEAR, it generates the texCoords the way you want. With eye linear, it's essential where you define the eye planes (as opposed to objects planes in object linear). If you need the absolute z:s you define them before the camera transform, and if you need the depth from camera, define them after it.

    -Ilkka

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2002
    Location
    kremnica, slovakia, europe, earth, sol :-)
    Posts
    102

    Re: glTexGen

    actually GL_EYE_LINEAR was my first choice but it produced weird results. the problem was just as you said, i generated texture coordinats BEFORE gluLookAt. now it's working cool! thnx!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •