Hi Sharad, I think you missing concatenate the transformations, or an typing
error in method mul.
TransformGroup tg = new TransformGroup();
: // any transformation on tg
:
-> if you want rotate about the local axis :
Transform3D current = new Transform3D();
tg.getTransform(current);
Transform3D rotate = new Transform3D();
rotate.rotX(Math.PI); // for example
current.mul(rotate); // composite : current * rotate
tg.setTransform(current); // update
-> if you want rotate about the parent axis:
Transform3D current = new Trasform3D();
tg.getTransform(current);
Vector3f v = new Vector3f();
current.get(v); // get Translation
current.setTranslation(new Vector3f(0.0f, 0.0f, 0.0f)); // translate to
origin
Transform3D rotate = new Transform3D();
rotate.rotX(Math.PI); // for example
current.mul(rotate, current); // rotate * current
current.setTranslation(v); // return to original position
Good Luck !!
Sharad Sivaramakrishnan wrote:
> Hi,
> I have created a figure and Ive translated this figure to a point in the
> positive Y-Axis.Now, when I pass this translated object for interaction
> (say rotation on the press of a key) the object reverts back to its
> original position(at the origin) instead of the translated position, and
> starts rotating from there.
> Am i missing something?
> Sharad
>
> ===========================================================================
> 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".