I think Marco already answered your question. One problem is that your
second setQuat call should have an index of 1, not 0. Secondly, you are
correct in assuming that quaternions can only handle one full rotation of
360 degrees around any axis. As a result, as Marco pointed out, the
rotation for 0 and 360 degrees are equiivalent and the resulting
interpolation does nothing. If you want to represent a full 360 degree
turn, you need three key values: one quaternion each for the 0, 180 and 360
(same as 0) positions, thus requiring three setQuat calls with indexes
ranging from 0 to 2. You can't really get around this using the supplied
interpreters. The only way to properly rotate an object using any possible
euler angle is to store the angles for each keyframe, interpolate the angles
at each step and do individual axis rotations using one quaternion for each
axis starting with the unit matrix each time. This provides exactly what
you are looking for. I used this technique for a key-framing system I
implemented in a modeller I wrote for the Amiga platform years ago. The
technique also allowed me to avoid the problems normally associated with the
traditional technique for conversion of Euler angles to matrices as the
pitch approaches +- 90 degrees.
Roberto Speranza
President, Dot Internet Solutions Inc.
mailto:[EMAIL PROTECTED]
http://www.dotinc.net/
----- Original Message -----
From: Pascal Christian Fenkam <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: October 22, 1999 1:15 PM
Subject: Re: [JAVA3D] Using Quaternions and RotPosPathInterpolator
> First of all I have tried going from -3.14 to 3.14 and it doesn't work.
> Secondly I find a little bit normal that it behave like that. Because
> considering a rotation (roll, pitch, yaw)=(x,0,0) the quaternion will be
> (0,0,0,cos(x/2)). This means
> euler2Quat(x,0,0)=
> euler2Quat(-x,0,0)=euler2Quat(x+4k*pi,0,0)=euler2Quat(-x+4k*pi,0,0)
> (0,0,0,cos(x/2)).
> for any integer k.
>
>
> Thank you for reactions.
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".