我在 Java3D 中导入 2 个模型,将它们按比例缩小,然后使用RotationInterpolator
但是,这会围绕原点旋转对象。我想围绕它的中心旋转对象,而不是场景的。简而言之,我希望它旋转到位。
如何围绕特定点旋转?
TransformGroup rotateTheBlades = new TransformGroup();
rotateTheBlades.setCapability(
TransformGroup.ALLOW_TRANSFORM_WRITE);
Alpha rotationAlpha = new Alpha(-1,5000);
RotationInterpolator rotator =
new RotationInterpolator(
rotationAlpha,rotateTheBlades);
Transform3D abc = new Transform3D();
abc.rotZ(Math.PI/2);
rotator.setTransformAxis(abc);
rotator.setSchedulingBounds(new BoundingSphere());
rotateTheBlades.addChild(rotator);
rotateTheBlades.addChild(theBlades);
这是我进行当前轮换的代码。