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: glTranslate - glRotate

  1. #1
    Guest

    glTranslate - glRotate

    On which matrix does process glTranslate and glRotate ?
    The one choose by glMatrixMode or always GL_MODELVIEW ?

  2. #2
    Junior Member Newbie
    Join Date
    Dec 2002
    Location
    Ann Arbor, MI , USA
    Posts
    4

    Re: glTranslate - glRotate

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glTranslatef(dx,dy,dz);
    or
    glRotatef(angel,dx,dy,dz);

    Originally posted by Matthieu DUFOURNEAUD:
    On which matrix does process glTranslate and glRotate ?
    The one choose by glMatrixMode or always GL_MODELVIEW ?

  3. #3
    Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: glTranslate - glRotate

    glTranslate* and glRotate* will affect whatever matrix is the currently active matrix.

    For example:
    Code :
    glMatrixMode(GL_TEXTURE);
    glRotatef(angle, 0.0f, 1.0f, 0.0f);
    The above code would rotate the texture on your object. Of course, you'd probably want to glPushMatrix() and glPopMatrix() around the changes to the texture matrix, and restore the modelview matrix after you were done.

    Hope that helps.

Posting Permissions

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