Crashes when trying to render a Box set to a PhongMaterial, with a Opacity in the Color Value.
Execute the examplecode , and set the color in the ColorPicker to a opacety value !=1.
Code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ColorPicker;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.Box;
import javafx.scene.shape.CullFace;
import javafx.scene.shape.DrawMode;
import javafx.stage.Stage;
public class JavaFXApplication30 extends Application {
@Override
public void start(Stage primaryStage) {
StackPane root = new StackPane();
Box bounds = new javafx.scene.shape.Box(10 ,10,10);
PhongMaterial material = new PhongMaterial();
ColorPicker tmp = new ColorPicker();
root.getChildren().add(tmp);
material.diffuseColorProperty().bind(tmp.valueProperty());
bounds.setMaterial(material);
bounds.setDrawMode(DrawMode.FILL);
bounds.setCullFace(CullFace.BACK);
root.getChildren().add(bounds);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
}
Execute the examplecode , and set the color in the ColorPicker to a opacety value !=1.
Code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ColorPicker;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.Box;
import javafx.scene.shape.CullFace;
import javafx.scene.shape.DrawMode;
import javafx.stage.Stage;
public class JavaFXApplication30 extends Application {
@Override
public void start(Stage primaryStage) {
StackPane root = new StackPane();
Box bounds = new javafx.scene.shape.Box(10 ,10,10);
PhongMaterial material = new PhongMaterial();
ColorPicker tmp = new ColorPicker();
root.getChildren().add(tmp);
material.diffuseColorProperty().bind(tmp.valueProperty());
bounds.setMaterial(material);
bounds.setDrawMode(DrawMode.FILL);
bounds.setCullFace(CullFace.BACK);
root.getChildren().add(bounds);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
}