----- Original Message -----
From: "Mike Butt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 18, 2001 11:31 AM
Subject: [JAVA3D] Problems with Quaternions


> Dear all,
>
> Firstly, I have read all the previous mail and have read all
the items
> suggested but I am still having problems with
RotPosPathInterpolator.
>
> My problem is that I have a bearing of an object which in
Euler angles goes
> (0,Y,0).  Y has a value from 0 to 360.  I run it through a
conversion
> method to turn it into Quat4f and it seemed to work OK until X
is between
> certain angles and the quaternion produced has a negative
number for one of
> the variables.  The object controlled by the
RotPosPathInterpolator then
> resets itself to the angle it starterd at.

The reason is that the correspondence between Euler angles and
quaternions (or AxisAngles) isn't unique.  This subject gets
beaten to death every few months in comp.graphics.algorithms.
Take a look at the recent traffic there on
www.groups.google.com, looking for something like +quaternions
+Euler.

I think that the standard advice is to avoid Euler angles at all
costs for reasons cited, but if you can't, the resources you'll
find through c.g.a will help you get around the singularities.

It looks from your sketch that all you're after is a simple
(Earth's moon) orbital behavior, and you might be able to do
that directly in AxisAngle, getting the camera pan angle
directly from the boom azimuth angle (depending how you have it
set up.)

hth,

Fred Klingener
Brock Engineering

>
> Any ideas on the problem?  Is it the RotPosPathInterpolator,
bad
> conversion?  The way I am trying to do it?
>
> What I am trying to achive is as a camera moves in a circle,
it always
> faces forward.  A drawing of what I am trying to achieve is
attached.
>
> Any help would be greatly apprecitated and I am sorry for any
repetition of
> the subject,
>
> Regards,
>
> Mike Butt

===========================================================================
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".

Reply via email to