Example usage for javafx.scene.shape Box setMaterial

List of usage examples for javafx.scene.shape Box setMaterial

Introduction

In this page you can find the example usage for javafx.scene.shape Box setMaterial.

Prototype

public final void setMaterial(Material value) 

Source Link

Usage

From source file:nars.rl.util.ThreeDView.java

private void buildAxes() {
    final PhongMaterial redMaterial = new PhongMaterial();
    redMaterial.setDiffuseColor(Color.DARKRED);
    redMaterial.setSpecularColor(Color.RED);

    final PhongMaterial greenMaterial = new PhongMaterial();
    greenMaterial.setDiffuseColor(Color.DARKGREEN);
    greenMaterial.setSpecularColor(Color.GREEN);

    final PhongMaterial blueMaterial = new PhongMaterial();
    blueMaterial.setDiffuseColor(Color.DARKBLUE);
    blueMaterial.setSpecularColor(Color.BLUE);

    final Box xAxis = new Box(240.0, 1, 1);
    final Box yAxis = new Box(1, 240.0, 1);
    final Box zAxis = new Box(1, 1, 240.0);

    xAxis.setMaterial(redMaterial);
    yAxis.setMaterial(greenMaterial);//  w  w w  .  j av a  2  s. co  m
    zAxis.setMaterial(blueMaterial);

    axisGroup.getChildren().addAll(xAxis, yAxis, zAxis);
    world.getChildren().addAll(axisGroup);
}