[Bf-committers] Quat interpolation and shortest distances problem

Roland Hess rolandh at reed-witting.com
Wed Mar 22 18:26:56 CET 2006


While working with Action Baking (translating object-level motion  
into a bone-level Action), I've run across a small deficiency in the  
way that Blender handles moving between some quat positions.

The problem is that under certain conditions what should be a 10  
degree rotation along an axis in the course of a few frames turns  
into a 350 rotation, generating a "flipping" effect. It seems that  
when smoothly interpolating between two quat positions, Blender on  
occasion does not choose the shortest route. This problem was noted  
already in OGRE, and a search turned up this page in their Wiki that  
references the problem:

http://www.ogre3d.org/wiki/index.php/Quaternion_and_Rotation_Primer

It is noted in the question "Why do I occasionally get a flickering  
of my object while it is rotating?"

The answer (from the OGRE wiki) is:

"A. Quaternion::Slerp(), Quaternion::nlerp() etc. have a  
"shortestPath" parameter that defaults to false. Ensure it is true,  
otherwise the interpolation occasionally goes the longer path, which  
might result in a few frames of completely discontinuous orientations."

And while the technical aspects are lacking there, it seems this  
problem has been identified and solved elsewhere. I've been informed  
that fixing this deficiency is on someone's To Do List, and I thought  
it would be a good idea to post for the record that a fix already  
exists (albeit in a different software package), and that the OGRE  
sources might be a good place to start.

Roland Hess
harkyman


More information about the Bf-committers mailing list