Class Sphere

All Implemented Interfaces:
Styleable, EventTarget

public class Sphere extends Shape3D
The Sphere class defines a 3 dimensional sphere with the specified size. A Sphere is a 3D geometry primitive created with a given radius. It is centered at the origin.
Since:
JavaFX 8.0
  • Property Details

  • Constructor Details

    • Sphere

      public Sphere()
      Creates a new instance of Sphere with radius of 1.0. The resolution defaults to 64 divisions along the sphere's axes.
    • Sphere

      public Sphere(double radius)
      Creates a new instance of Sphere with the given radius. The resolution defaults to 64 divisions along the sphere's axes.
      Parameters:
      radius - Radius
    • Sphere

      public Sphere(double radius, int divisions)
      Creates a new instance of Sphere with the given radius and number of divisions. The resolution is defined in terms of number of subdivisions along the sphere's axes. More divisions lead to more finely tesselated objects. Note that divisions should be at least 1. Any value less than that will be clamped to 1.
      Parameters:
      radius - Radius
      divisions - Divisions
  • Method Details

    • setRadius

      public final void setRadius(double value)
      Sets the value of the property radius.
      Property description:
      Defines the radius of the Sphere.
      Default value:
      1.0
    • getRadius

      public final double getRadius()
      Gets the value of the property radius.
      Property description:
      Defines the radius of the Sphere.
      Default value:
      1.0
    • radiusProperty

      public final DoubleProperty radiusProperty()
      Defines the radius of the Sphere.
      Default value:
      1.0
      See Also:
    • getDivisions

      public int getDivisions()
      Retrieves the divisions attribute use to generate this sphere.
      Returns:
      the divisions attribute.