PDA

View Full Version : Rotate object on absolute axes, the order matters



lolzoromg
03-20-2012, 03:02 PM
Hey there!
I need to rotate a cube on fixed axes (x and z). The order of the rotations does matter for me. So rotations: x90,x90,z90,x90 != x270, z90. Should i use quaternions for this?

thokra
03-21-2012, 03:00 AM
What's wrong with Euler angles for this task? You sure don't need smooth interpolation for such a simple animation.

lolzoromg
03-21-2012, 11:47 AM
if i rotate on one axis the other axes turn too, so after the first rotation i have to determine the new axes.

MaxH
03-22-2012, 11:05 AM
if i rotate on one axis the other axes turn too, so after the first rotation i have to determine the new axes. Correct. Sounds like what you want are object space rotations.
Check out the code below. It does both object and screen space rotations.

http://www.mfwweb.com/OpenGL/Special_Rotations/