Class 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.

    • 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 tetrahedron n times.
        Parameters:
        n - number of recursive subdivisions
        Throws:
        IllegalArgumentException - if n 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 tetrahedron n 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 subdivisions
        hole - do not render one of the four triangles of the tetrahedron
        sierpinski - create Sierpinski triangles
        Throws:
        IllegalArgumentException - if n is less than 0