Hi Vladimir,

using different nodes for translation and rotation is looking easy at first.
But controlling the navigation of an object (viewplatform or scene object)
gets more complicated this way.
You can multiply the matrices containing the translation and rotation
information one after the other with the actual transform3D of the
transformGroup you are interested in. navigation  can be done now in one
behavior call.

new_Transform3D =  rotation_Transform3D * translation_Transform3D *
current_Transform3D

translation and rotation information can be calculated using the difference
of consecutively read mouse coordinates. In your example, you want to move a
car, rotation must be done in this way: first transform the car into the
origin of its local coord system, next apply the rotation and now transform
it back to its former place. I don't know if that all can be done with the
navigation behaviors in the com.sun package. Maybe you have to write your
own classes.

Gernot Veith
[EMAIL PROTECTED]
http://www.janet.de


> -----Original Message-----
> From: Vladimir Olenin [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 23, 1999 6:30 PM
> To: [EMAIL PROTECTED]
> Subject: [JAVA3D] Rotation of translated TransformGroup
>
>
> Let say i've got the following node:
>
> ----------
>  rotationTransformGroup
>     |
>     +--translationTransformGroup
>           |
>           +--objectToBeTransformed
> ----------
>
> This structure allows to rotate and translate an object in the same
> time, but in a smart way. Eg, translation group moves the object
> forward/backward along Z axis, while rotaionGroup rotates translation
> group around Y axis. This allows to simulate car controls.
> (translation
> group corresponds to car acceleration/deceleraion, rotation group does
> left/right turn). The main problem is that with translation
> group moving
> away from (0, 0, 0), liniar distance along cirle edge that corresponds
> to some angle would constantly increase. I think
> rotationTransformGroup
> translation to the point where translationTransformGroup is situtated
> would resolve the problem, but i wonder if there is some other smarter
> way to achive my goal?
> Want to say beforehand I don't want to use default
> KeyNavigatorBehavior.
>
> Hope u know the answer and is going to email it right now. Thank u,
> then, whoever u r.
> vladimir
> --
>              -=V=-
> >~~~~~~~<=============>~~~~~~~<
> Join in Java community now!
> http://javacafe.virtualave.net/
> >~~~~~~~<=============>~~~~~~~<
>
> ==============================================================
> =============
> 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