QUESTION ABOUT JAVA3D
Hello,
I have a question about java 3d.
This is my first time i work with j3d so my question is probably a peace of cake for you.
I've made a cylinder with help from the tutorial. But this cylinder stays vertical. I want to topple over this cylinder for 90 degrees.
With other words: i want a horizontally cylinder.
Can please someone help me!!
TnX JOJO
This an example how to rotate Cube over X and Y axes:
public BranchGroup createSceneGraph() {
BranchGroup rootGroup = new BranchGroup();
Transform3D xRotate = new Transform3D();
Transform3D yRotate = new Transform3D();
xRotate.rotX(Math.PI/2.0d);
yRotate.rotY(Math.PI/5.0d);
xRotate.mul(yRotate);
TransformGroup rotGroup = new TransformGroup(xRotate);
rotGroup.addChild(new ColorCube(0.4));
rootGroup.addChild(rotGroup);
return rootGroup;
}
The more detailed information is on:
http://java.sun.com/developer/onlineTraining/java3d/
If you're going to be working with java 3D, it's definitely worth your while to learn about Transform3D (actually, this is pretty well a MUST). And it's probably also worth while to learn about matrix transformations for translations, rotations, scaling, and shears, as well as learning about quaternions for rotations.
you should try googling for 3D Matrix Transformations, and for Quaternions.
- Adam