Many peoples looks for that feature, without knowing that it's impossible to
get accurate results for any combination of doubles in the matrix. As much
as I know there is no software library that's capable of reliably getting
the euler angles. Besides that, you can put inside transform3d any kind of
transformations, which does not resolve to rotations. Particular problems
with shears, mirrors, non-affine transformations.

I do believe that the main reason for NOT providing a "getEuler" method is
the lack of a publicly available *reliable* algorithm.

In computer graphics, peoples are in general encouraged to use quaternions,
which represents univoquely a spatial orientation. Methods for retrieving
quaternions are already provided. A short method to extract eulers from
quaternions (I haven't tested it) is presented at:

http://www.martinb.com/maths/geometry/rotations/conversions/quaternionToEule
r/index.htm

Cheers,

Florin

-----Urspr�ngliche Nachricht-----
Von: Ian Nieves [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 18. Juni 2003 13:52
An: [EMAIL PROTECTED]
Betreff: Re: [JAVA3D] AW: [JAVA3D] Transform3D and angles issue (fwd)


Florin,

Do you think we should make this get method a feature request?  I have
seen in the past that people actually want this functionality.. even
though they may not understand the underlying issues.

Thoughts?
Ian


> There is no way you can be sure you get the *exact* angles you have
> entered.
> That's because there are more possible rotations that you can use to
> achieve
> the same effect.
>
> As an alternative to the algorithm you're using, I have previously posted
> here a more elaborate algorithm (and more time consumming) for extracting
> euler angles, which will attempt to retrieve the "best looking solution".
> However, you may use it also to retrieve all possible combinations of
> angles. See link below:
>
>
http://www.starfireresearch.com/services/java3d/samplecode/FlorinEulers.html
>
> Cheers,
>
> Florin
>
>
> -----Urspr�ngliche Nachricht-----
> Von: Fabrizio NUNNARI [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 18. Juni 2003 11:44
> An: [EMAIL PROTECTED]
> Betreff: Re: [JAVA3D] Transform3D and angles issue (fwd)
>
>
> Implemented. It works, but...
>
> For little angles I get:
> Setting angles <0.0,0.5699999999999998,0.0>
> Back-calculated euler angles are alpha=0.0, beta=0.5699999999999998,
> gamma=0.0
>
> but when I pass the PI/2 rotation:
> Setting angles <0.0,-2.1600000000000006,0.0>
> Back-calculated euler angles are alpha=-3.141592653589793,
> beta=-0.9815926535897926, gamma=-3.141592653589793
>
> I know the result is the same, but...
> Any further suggestion? Otherwise I'll keep it like that.
>
>
> Mark Whitehorn wrote:
>>  A good reference for this sort of thing is Chapter 2 of "Introduction
>> to
>>  Robotics Mechanics and Control" by John J. Craig (Addison Wesley).
> Here's
>>  equation 2.66 from section 2.8:
>>
>>  beta = atan2(-r_31, sqrt(r_11^2 + r_21^2))
>>  alpha = atan2(r_21/cos(beta), r_11/cos(beta))
>>  gamma = atan2(r_32/cos(beta), r_33/cos(beta))
>>
>>  alpha, beta, gamma are ZYX Euler angles for the 3x3 rotation matrix
>> r_ij...
>>
>> It's just trigonometry.
> Just... ;-)
>
>>
>>  Good luck with the PhD,
> I'll need it....
>
> Fabrizio
>
>>  Mark
>>
>>
>>
>>>----- Original Message -----
>>>From: "Fabrizio NUNNARI" <[EMAIL PROTECTED]>
>>>To: <[EMAIL PROTECTED]>
>>>Sent: Tuesday, June 17, 2003 9:48 AM
>>>Subject: [spam: 07.00/05.00] [JAVA3D] Transform3D and angles issue
>>>
>>>
>>>
>>>>Hello,
>>>>
>>>>I'm getting confused by the tons of methods of the Transform3D class.
>>>>Is it possible to retrieve the rotational component stored in a matrix?
>>>>I mean "just the three angles around the three axes".
>>>>
>>>>I normally use the (misleading, at least for me) .setEuler(Vector3d
>>>>euler) method. I'm looking for an equivalent .getEuler(Vector3d euler)
>>>
>>>one.
>>>
>>>>I also saw a .set(AxisAngle4d a1). I never tried it, but a
>>>> corresponding
>>>>.get(AxisAngle4d a1) doesn't exist.
>>>>
>>>>Finally, there is the copule .get/.set(Quat4d rot), but I haven't been
>>>>able to understand the relation between the stored (normalized) values
>>>>and angles value.
>>>>
>>>>What's the difference between .setEuler(Vector3d), .set(AxisAngle4d)
>>>> and
>>>>.set(Quat4d rot) ????
>>>>
>>>>
>>>>
>>>>The purpose? I have an object moved/rotated by a TransfromGroup. I want
>>>>to rotate it around a generic axes and then retrieve and print out the
>>>>resulting rotation angles (in the "Euler" form).
>>>>
>>>>Is it possible?
>>>>
>>>>
>>>>thanks,
>>>>Fabrizio NUNNARI
>>>>
>>>>--
>>>>Fabrizio Nunnari (nunnarif at di.unito.it)
>>>>PhD Student - Computer Science Department - Torino - Italy
>>>>http://www.di.unito.it/~nunnarif/
>>>>
>>>>
>>>
>>
>
==========================================================================>
>>>>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".
>>
>
>
> --
> Fabrizio Nunnari (nunnarif at di.unito.it)
> PhD Student - Computer Science Department - Torino - Italy
> http://www.di.unito.it/~nunnarif/
>
>
==========================================================================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".
>
>

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

Reply via email to