Package renderer.models_L
Class SphereSubdivided
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.SphereSubdivided
-
public class SphereSubdivided extends Model
Create a wireframe model of a sphere centered at the origin by recursively subdividing the faces of a tetrahedron.Also use this subdivision process to draw Sierpinski triangles on the surface of the sphere.
-
-
Field Summary
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description SphereSubdivided()
Create a sphere centered at the origin by recursively subdividing the faces of a tetrahedron four times.SphereSubdivided(int n)
Create a sphere centered at the origin by recursively subdividing the faces of a tetrahedronn
times.SphereSubdivided(int n, boolean hole, boolean sierpinski)
Create a sphere centered at the origin by recursively subdividing the faces of a tetrahedronn
times.
-
-
-
Constructor Detail
-
SphereSubdivided
public SphereSubdivided()
Create a sphere centered at the origin by recursively subdividing the faces of a tetrahedron four times.
-
SphereSubdivided
public SphereSubdivided(int n)
Create a sphere centered at the origin by recursively subdividing the faces of a tetrahedronn
times.- Parameters:
n
- number of recursive subdivisions- Throws:
IllegalArgumentException
- ifn
is less than 0
-
SphereSubdivided
public SphereSubdivided(int n, boolean hole, boolean sierpinski)
Create a sphere centered at the origin by recursively subdividing the faces of a tetrahedronn
times.The
hole
parameter leaves out one of the original four triangle faces of the tetrahedron. This creates a hole in the final sphere that is useful for looking at the back side of the sphere.The
sierpinski
parameter creates Sierpinski triangles on the sphere.- Parameters:
n
- number of recursive subdivisionshole
- do not render one of the four triangles of the tetrahedronsierpinski
- create Sierpinski triangles- Throws:
IllegalArgumentException
- ifn
is less than 0
-
-