Essential Math Weblog

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:

C++:
  1.  
  2. float recip = 0.5f/s;
  3.  

The fixed code should be:

C++:
  1.  
  2. float recip = 1.0f/s;
  3.  

This should be corrected in both IvMatrix33 and IvMatrix44.

Powered by WordPress

Bad Behavior has blocked 51 access attempts in the last 7 days.