THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/09/2005 at 08:26, xxxxxxxx wrote:
Cinema 4D Version: 9.1
Platform: Windows ; Mac ;
Language(s) : C++ ;
The problem in MatrixToRotAxis is this code
// Achse berechnen
*v = !(*v);
if the matrix is near identity then v will be really small.. the normalization however will bring it to length 1. This results in an almost random unit vector. Which is now our rotation axis..
My workaround is:
v = Vector(1,0,0);
w = 0;
v = SV(!(q.v));
w = 2.0*acos(q.w);
Not that you would call this efficient. But it seems to work.