import javafx.application.Application; import javafx.scene.AmbientLight; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.paint.Color; import javafx.scene.paint.PhongMaterial; import javafx.scene.shape.Box; import javafx.scene.shape.CullFace; import javafx.stage.Stage; public class Bug3D extends Application { public static final float D = 200; @Override public void start(Stage primaryStage) throws Exception { PhongMaterial material = new PhongMaterial(Color.RED); Box box = new Box(D, 0, D); box.setMaterial(material); box.setCullFace(CullFace.NONE); AmbientLight ambientLight = new AmbientLight(Color.WHITE); Group root = new Group(); root.getChildren().add(box); root.getChildren().add(ambientLight); Scene scene = new Scene(root, D, D); primaryStage.setScene(scene); primaryStage.show(); } /** * Java main for when running without JavaFX launcher */ public static void main(String[] args) { launch(args); } }