Essential Math Weblog Thoughts on math for games

6/29/2004

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:

  1. float recip = 0.5f/s;

The fixed code should be:

  1. float recip = 1.0f/s;

This should be corrected in both IvMatrix33 and IvMatrix44.

Powered by WordPress