I already post the same question in beginner part, but no answer, so I put it here…
I would like to be able to rotate about original Y and Z axis.
I already tried this:
glRotatef(rotY, 0, 1, 0)
glRotatef(rotZ, 0, 0, 1)
with those, it rotate about original Y-axis, and then rotate about “new” Z-axis.
What should I do to rotate both about original(static) Y and Z-axis.
Actually that’s not what is happening in your code: you’re first rotating around the world Z axis, and then you rotate around the world Y axis.
In Ogl (and all platforms I’ve seen, thank god) transformation are applied in the reverse order they’re set, to be able to push/pop on the matrix stack (like setting the camera transformation, pushing, setting first object’s mtx and rendering it, poping, same for next object etc.). There is no such thing as “new” or “local” Z axis.
That’s already what’s happening. You seem to want to simply reverse the order of the rotations (that is, swap these two code lines).