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: Retrieving Coordinates after rotations

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    14

    Retrieving Coordinates after rotations

    Hello Guys,

    I'm rotating my camera using glRotatef, this work's fine, but my problem is how can I get the new coordinates.

    For example I draw a line, after I make a rotation. If I draw a new line, they're coordinates is wrong. But if I rotate the camera to the original angle, the line is in correct position.

    How can I make this tranformation?



    Thank´s for the moment.

    Joe Ramone

  2. #2
    Intern Newbie
    Join Date
    Apr 2001
    Location
    FL, USA
    Posts
    36

    Re: Retrieving Coordinates after rotations

    you want to save the original modelview matrix and restore it after you draw the primitives.

    glPushMatrix();
    glRotatef(...);
    draw_stuff();
    glPopMatrix();

    draw_more_stuff();
    When in doubt, press F1.

Posting Permissions

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