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 2 of 2

Thread: Global Coordinate System Transformations

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Newcastle, England
    Posts
    2

    Global Coordinate System Transformations

    Anyone know of example code that shows how you can maintain transformations along global coordinates even after rotating an object along one of its axis... (e.g. I rotate about the global X-axis, then want to rotate again, but along the global Z-axis, not local). Preferably this should be possible in a hierarchy of objects... The objcts are stored in display lists... And the program is ment to work like a CAD (3ds-Max) application.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: Global Coordinate System Transformations

    You use glPushMatrix() and glPopMatrix() do to that:

    glPushMatrix();
    Rotate aroundx axis
    //draw
    glPopMatrix(); //old position is used again, so axis are not not rotated
    glPushMatrix();
    Rotate aroundz axis
    //draw
    glPopMatrix();

    etc.

Posting Permissions

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