LWJGL glRotatef() without rotating axes?

Posted by Brandon oubiub on Game Development See other posts from Game Development or by Brandon oubiub
Published on 2011-06-28T08:15:02Z Indexed on 2011/06/28 8:31 UTC
Read the original article Hit count: 365

Filed under:
|
|

Okay so, I noticed when you rotate around an axis, say you do this:

glRotatef(90.0f, 1.0f, 0.0f, 0.0f);

That will rotate things 90 degrees around the x-axis. However, it also sort of rotates the y and z axes as well. So now the y-axis is pointing in and out of the screen, instead of up and down. So when I try to do stuff like this:

glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
glRotatef(whatever, 0.0f, 1.0f, 0.0f);
glRotatef(whatever2, 0.0f, 0.0f, 1.0f);

The rotations around the y and z-axes end up not how I want them. I was wondering if there is any way I can sort of rotate just the axes back to their initial position after using glRotatef(), without rotating the object back. Or something like that, just so that when I rotate around the y-axis, it rotates around a vertical axis.

© Game Development or respective owner

Related posts about java

Related posts about rotation