Class Cube3


  • public class Cube3
    extends Cube
    Create a wireframe model of a cube with its center at the origin, having edge length 2, and with its corners at (±1, ±1, ±1).

    This version of the cube model has each face of the cube cut up by a triangle fan.

    Here is a picture showing how the cube's eight corners are labeled.

    
                      v4=(-1,1,-1)
                      +---------------------+ v5=(1,1,-1)
                     /|                    /|
                    / |                   / |
                   /  |                  /  |
                  /   |                 /   |
                 /    |                /    |
             v7 +---------------------+ v6  |
                |     |               |     |
                |     |               |     |
                |     | v0=(-1,-1,-1) |     |
                |     +---------------|-----+ v1=(1,-1,-1)
                |    /                |    /
                |   /                 |   /
                |  /                  |  /
                | /                   | /
                |/                    |/
                +---------------------+
                v3=(-1,-1,1)          v2=(1,-1,1)
    
    See Also:
    Cube, Cube2, Cube4
    • Constructor Detail

      • Cube3

        public Cube3()
        Create a cube with its center at the origin, having edge length 2, with its corners at (±1, ±1, ±1). and with a triangle fan of four triangles in each face.
      • Cube3

        public Cube3​(int xCount,
                     int yCount,
                     int zCount)
        Create a cube with its center at the origin, having edge length 2, with its corners at (±1, ±1, ±1), and with each of the cube's faces containing a triangle fan with the given number of triangles along each of the x, y, and z directions.

        There must be at least one triangle along each direction.

        Parameters:
        xCount - number of triangles along the x-direction
        yCount - number of triangles along the y-direction
        zCount - number of triangles along the z-direction
        Throws:
        IllegalArgumentException - if xCount is less than 1
        IllegalArgumentException - if yCount is less than 1
        IllegalArgumentException - if zCount is less than 1