Essential Math Weblog Thoughts on math for games


Getting Axis and Angle from Rotation Matrix

Filed under: Erratical,Mathematical — Jim @ 11:36 am

There is a bug in the code that gets the axis and angle information from a rotation matrix. Where the angle is 180 degrees (the last else statement) it computes the reciprocal value incorrectly. The original code is:
float recip = 0.5f/s;
The fixed code should be:
float recip = 1.0f/s;
This should be corrected in both IvMatrix33 and IvMatrix44.

Powered by WordPress