/* * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ package javafxbugs; import javafx.animation.KeyFrame; import javafx.animation.KeyValue; import javafx.animation.Timeline; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.PerspectiveCamera; import javafx.scene.Scene; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.scene.transform.Rotate; import javafx.stage.Stage; import javafx.util.Duration; public class DirtyBug3D extends Application { public static void main(String[] args) { // System.setProperty("prism.dirtyopts", "false"); launch(args); } @Override public void start(Stage stage) throws Exception { final Rectangle r3d = new Rectangle(80, 80, Color.BLUE); r3d.setLayoutX(100); r3d.setLayoutY(100); Group group2 = new Group(r3d); r3d.setEffect(new javafx.scene.effect.ColorAdjust()); group2.setRotationAxis(Rotate.X_AXIS); group2.setRotate(250); Group group = new Group(); group.setTranslateY(100); group.getChildren().setAll(group2); Scene scene = new Scene(group, 600, 600); scene.setCamera(new PerspectiveCamera()); stage.setScene(scene); stage.show(); final Timeline timeline = new Timeline(); timeline.setCycleCount(Timeline.INDEFINITE); final KeyValue kv = new KeyValue(group2.rotateProperty(), 280); final KeyFrame kf = new KeyFrame(Duration.millis(5000), kv); timeline.getKeyFrames().add(kf); timeline.play(); } }