face_off opened this issue on Jul 11, 2005 ยท 5 posts
face_off posted Mon, 11 July 2005 at 10:01 PM
OK, I've been working on a major Poser application, and been stuck on a roation problem from about a week now. To cut a long story short, I'm trying to get a rotation matrix from a quaterion from Actor.WorldQuaternion. Now I've tried a number of methods for converting the quaternion to a rotation matrix - including http://www.flipcode.com/documents/matrfaq.html#Q54. The rotation for the X and Z axes is comes out ok, but not the Y Axis. So I did some tests.... A prop with 10 degrees X Rotation gives a Quat of (1.575, 0.1378, 0.0, 0) - where the tuple is ordered W, X, Y, Z. 10 degrees Z rotation gives (1.575, 0.0, 0.0, 0.1378) - notice the same magnitude, and X now at Z. But 10 degrees of Y rotation gives (1.571, 0.0, 0.2210, 0.0) Notice the magnitude has changed, and the Y variable is not the same as X/Y in the previous examples. Converting the 10 degrees Y rot quat into a rotation matrix and then working out the euler angles introduces a 2-3 degree error in the Y rotation. But it only happens on the Y rotation - X and Z are ok. Anyone got any thoughts on this?
Creator of PoserPhysics
Creator
of OctaneRender
for Poser
Blog
Facebook