[Bf-committers] possible quaternion bug

Ton Roosendaal bf-committers@blender.org
Fri, 28 Mar 2003 11:42:01 +0100


Hi Heikki,

Yes, you are right, the 'qw' part is in quat[0] in Blender. The  
QuatToSpher() function looks very confusing to me... it doesn't seem to  
be in use in Blender though.

-Ton-


On Wednesday, Mar 26, 2003, at 21:14 Europe/Amsterdam, Heikki Orsila  
wrote:

> 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
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton@blender.org