Hi Robert,

Thanks for your reply.

I'll try to prepare a code sample to demonstrate the issue. In a nutshell,
the issue seems to be that whenever the start and end quaternions are more
than 90 degrees apart, the end quaternion rotation is inverted making the
intermediate (and end) orientations what they should be.

André

-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de Robert Osfield
Envoyé : December 14, 2006 11:07 AM
À : osg users
Objet : Re: [osg-users] Quat::slerp OK ?

Hi Andre,

One things to be wary of the multiplication order, so if the article
uses one convertion while the OSG uses the opposite then expecting a
1:1 mapping can cause problems.  I don't know if this is the root of
the problem you are seeing as I know too little about what you are
trying.

If you think there is a problem then I'd recommend creating a small
unit test which reproduces the problem and then send this along.  For
instances modifying examples/osgunitests/osgunitests.cpp might be a
good place to add you test cases.

Cheers
Robert

On 12/14/06, André Garneau <[EMAIL PROTECTED]> wrote:
>
>
>
>
> 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/
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



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

Reply via email to