public void animate() { Timeline timeline = new Timeline( new KeyFrame( Duration.seconds(0), new KeyValue(translateZ.zProperty(), -20), new KeyValue(rotateX.angleProperty(), 90), new KeyValue(rotateY.angleProperty(), 90), new KeyValue(rotateZ.angleProperty(), 90)), new KeyFrame( Duration.seconds(5), new KeyValue(translateZ.zProperty(), -80), new KeyValue(rotateX.angleProperty(), -90), new KeyValue(rotateY.angleProperty(), -90), new KeyValue(rotateZ.angleProperty(), -90))); timeline.setCycleCount(Animation.INDEFINITE); timeline.play(); }
public void editOffset(Translate newMajorOffset) { this.offset.setX(newMajorOffset.getX()); this.offset.setY(newMajorOffset.getY()); this.offset.setZ(newMajorOffset.getZ()); }