Hi Glen,

 

There seemed to be an issue in the code (an inversion done at 90 degrees
instead of 180 being the suspect) but I did not have time to
investigate/prove it further and just replaced it with a different
implementation. See www.euclideanspace.com
<http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/s
lerp/index.htm> /maths/algebra/realNormedAlgebra/quaternions/slerp/index.htm

 

For my application, the sample code there works fine (read the text
completely though; your mileage may vary) as it got rid of the interpolation
issue. Eventually, time-permitting, I will get back to the original problem
to suggest a change in OSG.

 

Hope this helps,

 

André

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Glenn Waldron
Sent: April-03-07 7:25 PM
To: osg users
Subject: Re: [osg-users] Quat::slerp OK ?

 

Andre,

Did you ever confirm or find a solution for this? I believe I am seeing the
same behavior. Thanks. -gw

On 12/14/06, André Garneau < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
wrote:

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/  <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/




-- 
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791 

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

Reply via email to