> From: Justin <[EMAIL PROTECTED]>
>
> I build my universe like your code shows in the Java3d Spec in the
> intro. I only want to make a few changes.
>
> I want to:
>
> 1) translate to [20, 20, 20]
> 2) rotate on the x -45 degrees (I do convert this to radians)
> 3) rotate on the y 45 degrees (also converted to radians)
>
> I can't do this with your Transform3D class because it resets the
> values, so previous steps don't carry over to the next step. I don't
> understand enough about matrices to apply the steps to a matrix.
You need to multiply the matrices into a result. Try this:
Transform3D result = new Transform3D();
Transform3D temp = new Transform3D();
result.setTranslation(new Vector3d(20, 20, 20)); // set translation
temp.set(new AxisAngle4d(1.0, 0.0, 0.0, toRadians(-45));
result.mul(temp); // post-concatinate rotation
temp.set(new AxisAngle4d(0.0, 1.0, 0.0, toRadians(45));
result.mul(temp);
transformGroup.setTransform(result);
Doug Gehringer
Sun Microsystems
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/