[Euler angles values are incorrect]
-
Hello Guys,
So I've used class QQuaternion to rotate an object but I also wanted to add a function that returns the euler angles that corresponds to the quaternion.
However, it seems that euler angles values are incorrect.
For example: my quaternion is ( w=0.758, x=-0.002 , y=-0.619 , z=0.206), it correpsonds to these euler angles values. x= 47.327, y=-69.927 and z= 64.519 ( verified with quaternion visualization app online).
however when I run my application, I get these values : x=14.5932, y= -76.0196,z=18.9784.Okay, the order in the application with which I verify the rotations is XYZ (there are also ZYX and YZX) but the function that I used in my code, returns euler angles from quaternion in the order ZXY according to Qt documentation
void QQuaternion::getEulerAngles(float *pitch, float *yaw, float *roll)
It Calculates roll, pitch, and yaw Euler angles (in degrees) that corresponds to this quaternion.
It means the order is ZXY. Am I right ?What shall I do to get the right angle values ? should I convert ZXY rotation returned by that function to other rotations ? or should I look for another application online that converts quaternion to ZXY euler angles to verify that my code works correctly ?