inline void getFactoredCoordinateAxisRotationDegreesIntoArray(double* theta) {
//Factor as RxRyRz, assumes that axiss are orthanormal
double thetaY = asin(m31);
theta[1] = thetaY;
if (thetaY < PI/2.0f) {
if (thetaY > -PI/2.0f) {
theta[0] = atan2(-m32, m33);
theta[2] = atan2(-m21, m11);
}
else {
theta[0] = -atan2(m12, m22);
theta[2] = 0.0f;
}
}
else {
theta[0] = atan2(m12, m22);
theta[2] = 0.0f;
}
}
thanks
Coordinate axis factoring of a rotation matrix
Assuming there there is just rotations specfied in a transformation how does one factor it into the product of three coordinate axis rotation Rx*Ry*Rz.
I have an algorithm which i believe works but its not quit giving me correct results :
the Factored rotations for matrix
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
1.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 1.000000
are 0.000000 89.999995 0.000000 about the x y z axis repectively, but as we can see this is not true. I''m not sure why this case is not working for my algorithm. Any ideas as to why this specfic matrix breaks the algorithm
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
1.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 1.000000
are 0.000000 89.999995 0.000000 about the x y z axis repectively, but as we can see this is not true. I''m not sure why this case is not working for my algorithm. Any ideas as to why this specfic matrix breaks the algorithm
Dave Eberly''s reference should help:
http://www.magic-software.com/Documentation/EulerAngles.pdf
See Section 2 "Factoring Rotation Matrices". Better yet, download his code, MgcMatrix.*, and use his implemented methods ToEulerAnglesXYZ(...), etc.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
http://www.magic-software.com/Documentation/EulerAngles.pdf
See Section 2 "Factoring Rotation Matrices". Better yet, download his code, MgcMatrix.*, and use his implemented methods ToEulerAnglesXYZ(...), etc.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement