[Bf-committers] possible quaternion bug
Heikki Orsila
bf-committers@blender.org
Wed, 26 Mar 2003 22:14:41 +0200 (EET)
I am not very familiar with quaternions, but blenlib/intern/arithb.c :
void QuatToSpher() looks odd comparing to VecRotToQuat().
QuatToSpher() has:
qx = quat[0];
qy = quat[1];
qz = quat[2];
qw = quat[3];
cos_theta = qw;
VecRotToQuat() has:
quat[1]= vec[0];
quat[2]= vec[1];
quat[3]= vec[2];
...
quat[0]= (float)cos( phi/2.0 );
Does blender use contradictory internal formats with quaternions?
The function QuatToSpher() has a comment that it might not work 100%.
Could the problem be fixed by just doing:
qx = quat[1];
qy = quat[2];
qz = quat[3];
qw = quat[0];
Haven't tested this. Just a suspicion.
Heikki Orsila There has yet to be any innovation, new
heikki.orsila@ee.tut.fi features or new capabilities out of the
http://ee.tut.fi/~heikki Linux platform. - Steve Ballmer of Microsoft