import javafx.application.Application; import javafx.scene.AmbientLight; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.scene.paint.Color; import javafx.scene.paint.PhongMaterial; import javafx.scene.shape.CullFace; import javafx.scene.shape.MeshView; import javafx.scene.shape.TriangleMesh; import javafx.stage.Stage; public class BlackTextureBug extends Application { public static final float D = 200; @Override public void start(Stage primaryStage) throws Exception { TriangleMesh mesh = new TriangleMesh(); mesh.setPoints(new float[] { 0, 0, 0, D, 0, 0, D, D, 0, 0, D, 0, }); mesh.setTexCoords(new float[] { -2, -2, 2, -2, 2, 2, -2, 2, }); mesh.setFaces(new int[] { 0, 0, 1, 1, 2, 2, 0, 0, 2, 2, 3, 3, }); PhongMaterial material = new PhongMaterial(); material.setDiffuseMap(new Image(BlackTextureBug.class.getResourceAsStream("cone-stripes.jpg"))); MeshView meshView = new MeshView(mesh); meshView.setMaterial(material); meshView.setCullFace(CullFace.NONE); AmbientLight ambientLight = new AmbientLight(Color.WHITE); Group root = new Group(); root.getChildren().add(meshView); 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); } }