PDA

View Full Version : Taking a rotation apart



moseslike
12-05-2013, 03:34 AM
Hi guys,
I have given a Rotation like

glRotatef(w, x, y, z);

Now IŽd like to take this apart and write it with three single rotations for the same result.

glRotatef(wx, 1, 0, 0);
glRotatef(wy, 0, 1, 0);
glRotatef(wz, 0, 0, 1);

How can I convert it?

Thanks,
Moseslike

Dan Bartlett
12-05-2013, 05:19 AM
Searching the web for "axis-angle to euler" returns this result: http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToEuler/