You can get the z-axis direction vector from your rotation matrix (third
column), then translate in that direction.  Don't know of a ready-made
function like you're after, but it isn't too hard to implement.

T3D.get(rotation_matrix)
z_axisVector.x=rotation_matrix.getElement(0,2)
z_axisVector.y=rotation_matrix.getElement(1,2)
z_axisVector.y=rotation_matrix.getElement(2,2)

z_axisVector.scale(moveAmt)

T3D.get(translation_vector)
translation_vector.add(z_axisVector)
T3D.setTranslation(translation_vector)

Daniel




> -----Original Message-----
> From: Ron Surratt [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, February 29, 2000 9:57 PM
> To:   [EMAIL PROTECTED]
> Subject:      [JAVA3D] Moving a transform3D in the direction it is facing
>
> >
>
> Hello all,
>
>     Is there some (clever) way to make a tranform (like the one for the
> ViewingPlatform) go x distance in the direction it is facing (rotated to),
> short of doing the trig on the rotation angles one at a time?  I guess I
> want is a function like
>
>     void moveWherePointed(Transform t1,float moveAmt)
>
> that updates t1's translation values from its rotational matix.   Am I
> missing something somewhere.  Does such a thing exist ?
>
> thanks,
> Ron
>
> ==========================================================================
> =
> 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