Removing the roll from a quaternion:

Started by
12 comments, last by Einstone 16 years, 5 months ago
So, then neither RotationYawPitchRoll or RotationAxis can be used without causing gimbal lock? Or are you saying it's ok to construct a quaternion or a matrix using eulers, but you can't get the info back out? I'm using MDX and I think Quaternion and Matrix have both of those functions.
Advertisement
I use MDX too. When you extract the RotationYawPitchRoll values from a matrix(or a quaternion) by using the methods in MDX, the values you get may not be the same as the ones you used to build the matrix, it is only one of the possible sets which you can use to built the same matrix.

I couldn't find any method in my MDX version which can get back the YawPitchRoll values. Does it realy exist in other versions?

[Edited by - Einstone on November 23, 2007 2:52:49 AM]
That function isn't used to extract the yaw/pitch/roll, it's use to create the quat/matrix. I'm just asking if using euler values in creating/rotating the quat/matrix is safe as long as I don't try to use extracted eulers to compute the new rotation.
Yes, it is absolutely safe from theory point of view.
Be carfull if use the Quaternion.ToAxisAngle(Quaternion quat, ref Vector3 axis, ref float angle) method provided in MDX, the return values may be NaN (Not a Number). It occoured in one of my applications and took me ages to track it down.

[Edited by - Einstone on November 23, 2007 9:19:11 PM]

This topic is closed to new replies.

Advertisement