Example usage for javafx.scene.shape Sphere Sphere

List of usage examples for javafx.scene.shape Sphere Sphere

Introduction

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

Prototype

public Sphere(double radius) 

Source Link

Document

Creates a new instance of Sphere with the given radius.

Usage

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  ava2  s.  co  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);

}