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
    Senior 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.

Similar Threads

  1. glrotate, gltranslate - VBO
    By macsam in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-08-2018, 05:52 AM
  2. How to interchange glTranslate - glRotate
    By carla_sch in forum OpenGL: General
    Replies: 1
    Last Post: 02-16-2013, 02:40 AM
  3. glRotate / glTranslate Help
    By xandred in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-18-2012, 09:57 PM
  4. Understanding glRotate and glTranslate
    By c00der in forum OpenGL: General
    Replies: 1
    Last Post: 10-16-2011, 02:16 AM
  5. gluLookAt vs glRotate glTranslate
    By m3ntol in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-02-2005, 04:19 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