Hi,

 

I’ve been implementing some interpolation code using quaternions the last
few days, and saw what I believe is incorrect behaviour when using the
quat::slerp method.

Looking at the code (modified from a gamasutra code sample), this is what I
believe is incorrect:

 

cosomega = from.asVec4() * to.asVec4();

if ( cosomega < 0.0 )

{

    cosomega = -cosomega

    quatTo = -to

}

 

Where “from” and “to” are the start quaternion value (t=0) and end value
(t=1) respectively.

 

If we try an interpolation from 0 degree to 91 degree (dotprod<0), the code
above changes the end quaternion orientation to be -91 degree instead of 91,
resulting in an invalid end orientation when t=1 (and the interpolation
generating intermediate angles in the wrong direction vs the expected
values).

 

Am I missing something ?

 

André

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to