Example usage for javafx.scene.paint PhongMaterial setDiffuseColor

List of usage examples for javafx.scene.paint PhongMaterial setDiffuseColor

Introduction

In this page you can find the example usage for javafx.scene.paint PhongMaterial setDiffuseColor.

Prototype

public final void setDiffuseColor(Color 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);/*from w ww.j  a va 2  s  .c  om*/
    yAxis.setMaterial(greenMaterial);
    zAxis.setMaterial(blueMaterial);

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

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

public void addPoint(Object o, double radius, double x, double y, double z) {

    Term t = (Term) o;//from w  w  w .  j  a v a 2  s  .c o  m

    final PhongMaterial mat = new PhongMaterial();
    Color c = Color.hsb(255.0 * Video.hashFloat(o.toString().hashCode()), 0.75f, 0.85f);
    mat.setDiffuseColor(c);
    System.out.println(o.getClass());
    Sphere point = new Sphere(radius / t.complexity());
    point.setOpacity(0.85);
    point.setTranslateX(x);
    point.setTranslateY(y);
    point.setTranslateZ(z);
    point.setMaterial(mat);

    space.getChildren().add(point);

    Text text = new Text(o.toString());
    text.setFill(c);
    text.setFontSmoothingType(FontSmoothingType.LCD);
    text.setSmooth(true);
    text.setTextAlignment(TextAlignment.CENTER);
    text.setFont(font);
    /*
    text.setScaleX(0.05);
    text.setScaleY(0.05);
    text.setScaleZ(0.05);
    */
    text.setTranslateX(x);
    text.setTranslateY(y);
    text.setTranslateZ(z);
    space.getChildren().add(text);

}