I have looked at the code you sent me, and I was able to make the models spin. There are several wrong doings in your code.
1. First of all, you should set the "scheduling bounds" of the rotation
interpolator and not the bounds!!! That's why it's not spinning right from
the begining.
2. It's good practice not to directly manipulate the model you have loaded,
but instead create a new transform group in which you add the model. That
new transform group make it to be the target of the rotation interpolator.
3. Changing the rotation axis: since the 3D domain, in general, needs a
basic knowledge of euclidian geometry, I suggest starting with some simple
geometry books discussing the subject of 3d transformations, axis of
transformations, conversions between degrees and radians, etc. - Math.PI * 2
/ 180 represents an angle of 2 decimal degrees, which is barely detectable
by human eyes.
I have attached back the working version of your Panel3D.
Cheers,
Florin
P.S. You have a horrible synchronization/repaint problem. I suggest you to
not directly use the Canvad3D but to extend it and add in it the method:
public void paint(Graphics g)
{
super.paint(g);
Toolkit.getDefaultToolkit().sync();
}
-----Ursprüngliche Nachricht-----
Von: Sandegren, Eric S. [mailto:[EMAIL PROTECTED]
Gesendet: Sonntag, 23. Februar 2003 23:43
An: [EMAIL PROTECTED]
Betreff: [JAVA3D] Transform3D Question
I am reading about the RotationInterpolator class and how it takes the
Transform3D handed to it and uses it to define the coordinate system about
which it will always rotate on the Y Axis. I understand everything up to
about this point.
My end goal is to show the user a simple cube that can about either the x,
y, or z axis. So from what I see I need to tell the Transform3D that I pass
in, that the coordinate system should be on it's side or something
(depending on whether I want X or Z).
Any wisdom on this subject?
Thank you
Eric Sandegren
===========================================================================
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".
Panel3D.java
Description: Binary data
