PDA

View Full Version : glRotate Question



S4pphire
10-16-2004, 04:18 PM
I have a question about using glRotate: Say I want to rotate an object by 180 degrees about the coordinate system x-axis and then 180 about the coordinate system y-axis. It seems that when I do this, it performs the first rotation correctly, but the second rotation is inverted. i.e., it will be in the opposite direction from if I just do a 180 rotate about the y-axis without a prior 180 x-axis.

MikeC
10-17-2004, 12:58 AM
Yes, that's right. Rotations, like the other transformations, are relative to the current coordinate space, not to some "global" coordinate space.

Imagine a transparent analog clock lying flat on a table, face up. If you look down on it from above the hands appear to be moving clockwise. If you turn the clock face down, the hands will now appear to be moving anticlockwise, even though you're still looking at it from the same viewpoint and the clock itself is doing exactly the same thing as before.

S4pphire
10-17-2004, 04:01 AM
Thanks! So then there's no way to keep the axes in global coordinates while rotating an object?