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.Polygon; import javafx.scene.shape.Rectangle; import javafx.scene.transform.Rotate; import javafx.stage.Stage; /** * * @author cyang */ public class SimpleClipBug extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { Polygon clip = new Polygon(0.0, 0.0, 60.0, 0.0, 30.0, 50.0); Rectangle node = new Rectangle(60.0, 50.0, Color.RED); node.setClip(clip); node.setRotationAxis(Rotate.Y_AXIS); node.setRotate(10); Group root = new Group(node); Scene scene = new Scene(root, 100, 100, true); scene.setCamera(new PerspectiveCamera()); primaryStage.setScene(scene); primaryStage.setVisible(true); } }