Java3D spin loss while trying to revive

I created Cylinder and rotated it so that it lay on its side. It works great.

However, now I'm trying to add some animation to it. I encoded the animation using PositionInterpolar and it works great and moves along the right axis.

The problem is that it seems to me that I used to overwrite my Transform3D to rotate the cylinder in the first place, so my cylinder did not stand upright and moved along the sides.

Any ideas? Do I need to rotate the object in a different way?

+4
source share
1 answer

Perhaps this could be a simple example where, as I recall, Java3D likes to use different Transform3D objects for each rotation, etc. For instance:

 public class Static3DWorld extends JFrame { private Transform3D rotate1 = new Transform3D(); private Transform3D rotate2 = new Transform3D(); .... private Transform3D rotateCube() { rotate1.rotX(Math.PI / 4.0d); rotate2.rotY(Math.PI / 4.0d); rotate1.mul(rotate2); return rotate1; } .... } 

Is this how you do your rotations etc ?? You can see the tutorial here: http://www.java-tips.org/other-api-tips/java3d/introduction-to-java3d-api-5.html

+2
source

All Articles