Hi,
Here’s the link: http://www.kingsware.de/j3d/gamerot.zip
I have a new problem. I update only the x- and y-rotation of my ship every Frame. It sets the rotation by looking at the Mouse position. But my ship rotates over all axis x,y AND z, but not at the same time!!! It looks like Java3D decides, which are the x and y axis from the viewplatforms point of view!! Is that right?
How can I set a “local”-Rotation, which rotates the local axis not the “viewed” one???
I had the same problem, only the other way around, with Translation. The ship moved on the global axis instead of flying, depending on the ships current rotation.
I fixed this problem like this(not exactly):
//Position
Vector3f position = new Vector3f(x,y,z);
Transform3D posTrans = new Transform3D();
//Rotation
Transform3D rotX3d = new Transform3D();
Transform3D rotY3d = new Transform3D();
Transform3D rotXY3d = new Transform3D();
//change the XY-Rotation (with MouseAngle)
rotX3d.rotX(xAngle);
rotY3d.rotY(yAngle);
rotXY3d.mul(rotX3d, rotY3d);
//The solution! now the positiontranslation is local!
rotXY3d.transform(position);
posTrans.set(position);
is there any possibility to do this with rotation. There must be the possibility to rotate over the local axis!
Greets and thanks,
Juan