public class SolidPolygonSphere extends AbstractCompositeShape
A solid sphere composed of triangular polygons.

The sphere is constructed using a latitude-longitude grid (UV sphere). The number of segments determines the smoothness - more segments create a smoother sphere but require more polygons.

Usage example:


 // Create a sphere with radius 50 and 16 segments (smooth)
 SolidPolygonSphere sphere = new SolidPolygonSphere(
     new Point3D(0, 0, 200), 50, 16, Color.RED);
 shapeCollection.addShape(sphere);
 
See Also:
  • Constructor Details

    • SolidPolygonSphere

      public SolidPolygonSphere(Point3D center, double radius, int segments, Color color)
      Constructs a solid sphere centered at the given point.
      Parameters:
      center - the center point of the sphere in 3D space
      radius - the radius of the sphere
      segments - the number of segments (latitude/longitude divisions). Higher values create smoother spheres. Minimum is 3.
      color - the fill color applied to all triangular polygons