我正在尝试在javafx中围绕另一个球体旋转球体。不知何故,当我将我的相机转换为新的Translate(0,0,-100)时,当它到达屏幕的远端并且无法弄清楚如何解决时,形状会消失。到目前为止,这是我的代码:
Sphere earth = new Sphere(2);
earth.setTranslateZ(7);
earth.setTranslateX(28);
RotateTransition rt4 = new RotateTransition();
rt4.setNode(earth);
rt4.setDuration(Duration.millis(3000));
rt4.setAxis(Rotate.Y_AXIS);
rt4.setByAngle(360);
rt4.setCycleCount(Animation.INDEFINITE);
rt4.setInterpolator(Interpolator.LINEAR);
rt4.play();
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.getTransforms().addAll (
pivot,
yRotate,
new Rotate(-22, Rotate.X_AXIS),
new Translate(0, 0, -100)
);
我在此图片中标记了形状地球消失的位置image