[Bf-committers] Quaternion rotations

Ton Roosendaal ton at blender.org
Thu Nov 11 14:25:45 CET 2004


Hya,

In the NLA strip blending code, quaternions were interpolated simply  
linear, and worse; before the interpolation the quaternions were  
converted to a 3x3 matrix and back to quaternion. That most likely to  
enforce interpolations choosing the shortest path, but this definitely  
isn't a reliable method at all. As the comment in code already  
states...

Quaternions are nice mathemetically, and allow for good interpolations  
as well. In blender/blenlib/intern/arithb.c you now can find 2 versions  
for it,

The Watts brothers version:
void QuatInterpolW()

and my own:
void QuatInterpol()

http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/ 
blenlib/intern/arithb.c?r1=1.13&r2=1.14&root=bf-blender

That latter version was also based on googling, more people have found  
that solution. I don't really get the math of the Watts version... and  
it gives wrong results even.
Can anyone with quaternion & math experience check on these 2 functions?

Thanks!

-Ton-

------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton at blender.org  
http://www.blender.org



More information about the Bf-committers mailing list