I am trying to rotate around the X-Axis and the Y-Axis, but the cube is only rotating around one of them.
Here's my code:
TransformGroup objSpin = new TransformGroup();
objSpin.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
BranchGroup branchgroup = new BranchGroup();
branchgroup.addChild(transroot);
transroot.addChild(objSpin);
objSpin.addChild(new ColorCube(0.12));
Transform3D yAxis = new Transform3D();
yAxis.rotY(Math.PI/2.0);
Transform3D xAxis = new Transform3D();
xAxis.rotX(Math.PI/2.0);
Alpha rotationAlpha = new Alpha(-1, 7000);
Alpha rotationAlphaa = new Alpha(-1, 7000);
RotationInterpolator rotator =
new RotationInterpolator(rotationAlpha, objSpin, yAxis,
0.0f, (float) Math.PI*2.0f);
RotationInterpolator rotatora =
new RotationInterpolator(rotationAlphaa, objSpin, xAxis,
0.0f, (float) Math.PI*2.0f);
BoundingSphere bounds = new BoundingSphere();
BoundingSphere boundsa = new BoundingSphere();
rotator.setSchedulingBounds(bounds);
rotatora.setSchedulingBounds(bounds);
objSpin.addChild(rotator);
objSpin.addChild(rotatora);
What do I have to do to combine the two RotationInterpolators?