Well, I'll suppose for this answer you have some knowledge of vector
algebra, but I'm afraid you don't. These kind of stuff are not the scope
of a Java3D list, you could get better feedback from
comp.graphics.algorithms or other 3D math/algorithms list.
         Whenever you have a rotation, you can imagine a start position
and a final position, and an axis of rotation. At least it is easy to
figure out the center point of rotation (this point belongs to the axis of
rotation).
        Say you have a point called O that is the center of rotation, an
initial point A, and a final point B. As you have only the specification
of the X, Y and Z axis angles, you'll have to do some vanilla math to find
the point B coordinates (actually you need to know A,  B and 0
coordinates).
        Once you have all the coordinates needed, you have to assemble two
vectors, OA and OB. The OA vector is the original position, before the
rotation, and the OB vector connects the center point to the final of the
rotation.

        How to find the vector around which the rotation is done?
         - Find the vector that is the cross-product of OA and OB, then
normalize it.


        How to find the angle of rotation?
        - Find the dot-product of OA and OB. Then divide this value by the
absolute value of OA, then by absolute value of OB. The resultant value is
the cosine of the angle you want.


                        Hope this can be useful for you

                                        Fabio




On Thu, 2 Mar 2000, Nicolas Trussart wrote:

>         Hello,
>
> In VRML, there is a field named "Rotation" in the Transform node.
> I would like to know how the Rotation field works.
>
> I mean, how to transform 3 angles (around X, Y and Z axis), given in degrees,
> to the vector and the angle in radian whom this field needs.
>
> Transform       (vector's 3 components)
>         {               |
>                 |------------|
>         rotation 0.4 0.5 0.8  2.67
>         children             |----|
>                 [               |
>                 ]       (angle in radian)
>         }
>
> Thank for your help.
>
> Nicolas.
>
>
> -------------------------------
> Nicolas Trussart
> Département Génie Civil
> Université Laval, Québec
> e-mail : [EMAIL PROTECTED]
>
> ===========================================================================
> 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