Package eu.mihosoft.vrl.v3d
Class Sphere
java.lang.Object
eu.mihosoft.vrl.v3d.Sphere
- All Implemented Interfaces:
- Primitive
A solid sphere.
 Tthe tessellation along the longitude and latitude directions can be
 controlled via the 
numSlices and numStacks parameters.- Author:
- Michael Hoffer <info@michaelhoffer.de>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintintReturns the property storage of this primitive.doublevoidvoidsetNumSlices(int numSlices) voidsetNumStacks(int numStacks) voidsetRadius(double radius) Returns the polygons that define this primitive.
- 
Constructor Details- 
Spherepublic Sphere()Constructor. Creates a sphere with radius 1, 16 slices and 8 stacks and center [0,0,0].
- 
Spherepublic Sphere(double radius) Constructor. Creates a sphere with the specified radius, 16 slices and 8 stacks and center [0,0,0].- Parameters:
- radius- sphare radius
 
- 
Spherepublic Sphere(double radius, int numSlices, int numStacks) Constructor. Creates a sphere with the specified radius, number of slices and stacks.- Parameters:
- radius- sphare radius
- numSlices- number of slices
- numStacks- number of stacks
 
- 
SphereConstructor. Creates a sphere with the specified center, radius, number of slices and stacks.- Parameters:
- center- center of the sphere
- radius- sphere radius
- numSlices- number of slices
- numStacks- number of stacks
 
 
- 
- 
Method Details- 
toPolygonsDescription copied from interface:PrimitiveReturns the polygons that define this primitive. Note: this method computes the polygons each time this method is called. The polygons can be cached inside aCSGobject.- Specified by:
- toPolygonsin interface- Primitive
- Returns:
- a list of polygons that define this primitive
 
- 
getCenter- Returns:
- the center
 
- 
setCenter- Parameters:
- center- the center to set
 
- 
getRadiuspublic double getRadius()- Returns:
- the radius
 
- 
setRadiuspublic void setRadius(double radius) - Parameters:
- radius- the radius to set
 
- 
getNumSlicespublic int getNumSlices()- Returns:
- the numSlices
 
- 
setNumSlicespublic void setNumSlices(int numSlices) - Parameters:
- numSlices- the numSlices to set
 
- 
getNumStackspublic int getNumStacks()- Returns:
- the numStacks
 
- 
setNumStackspublic void setNumStacks(int numStacks) - Parameters:
- numStacks- the numStacks to set
 
- 
getPropertiesDescription copied from interface:PrimitiveReturns the property storage of this primitive.- Specified by:
- getPropertiesin interface- Primitive
- Returns:
- the property storage of this primitive
 
 
-