Java Code Examples for javafx.scene.Group#setDepthTest()

The following examples show how to use javafx.scene.Group#setDepthTest() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Sample3D.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
protected Sample3D(double width, double height) {
    super(width, height);
    Group group3d = new Group(create3dContent());
    group3d.setDepthTest(DepthTest.ENABLE);
    group3d.getTransforms().addAll(
            new Translate(width / 2, height / 2),
            new Rotate(180, Rotate.X_AXIS)
    );
    getChildren().add(group3d);
}
 
Example 2
Source File: Sample3D.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
protected Sample3D(double width, double height) {
    super(width, height);
    Group group3d = new Group(create3dContent());
    group3d.setDepthTest(DepthTest.ENABLE);
    group3d.getTransforms().addAll(
            new Translate(width / 2, height / 2),
            new Rotate(180, Rotate.X_AXIS)
    );
    getChildren().add(group3d);
}
 
Example 3
Source File: Cube3D.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 400, 150, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(400 / 2, 150 / 2),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
 
Example 4
Source File: CubeSystem3D.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 500, 500, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(500 / 2, 500 / 2),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
 
Example 5
Source File: AudioVisualizer3D.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 400, 500, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(400 / 2, 500 / 2 + 100),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
 
Example 6
Source File: Viewer3d.java    From phoebus with Eclipse Public License 1.0 5 votes vote down vote up
/** @param disabled Disable mouse interaction?
 *  @throws Exception on error
 */
public Viewer3d (final boolean disabled) throws Exception
{
    axes = buildAxes();
    view.getChildren().add(axes);

    root = new Group(view);
    root.setDepthTest(DepthTest.ENABLE);

    scene = new SubScene(root, 1024, 768, true, SceneAntialiasing.BALANCED);
    scene.setManaged(false);
    scene.setFill(Color.GRAY);
    scene.heightProperty().bind(heightProperty());
    scene.widthProperty().bind(widthProperty());

    buildCamera();

    scene.setCamera(camera);

    // Legend, placed on top of 3D scene
    final HBox legend = new HBox(10, createAxisLabel("X Axis", Color.RED),
            createAxisLabel("Y Axis", Color.GREEN),
            createAxisLabel("Z Axis", Color.BLUE));
    legend.setPadding(new Insets(10));

    getChildren().setAll(scene, legend);

    if (! disabled)
        handleMouse(this);
}