Package renderer.models_L
Class Cube4
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Cube4
-
public class Cube4 extends Model
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 the top and bottom faces of the cube cut up by a triangle fan and the front, back, right, and left faces cut up by a grid of perpendicular lines.
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)
-
-
Field Summary
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description Cube4()Create a cube with its center at the origin, having edge length 2, with its corners at(±1, ±1, ±1).Cube4(int xCount, int yGrid, int zCount)Create a cube with its center at the origin, having edge length 2, with its corners at(±1, ±1, ±1), and with the top and bottom faces containing a triangle fan with the given number of triangles along each of the x, and z directions.
-
-
-
Constructor Detail
-
Cube4
public Cube4()
Create a cube with its center at the origin, having edge length 2, with its corners at(±1, ±1, ±1). with a triangle fan of eight triangles in top and bottom faces, and two perpendicular lines cutting each of the front, back, right, and left faces.
-
Cube4
public Cube4(int xCount, int yGrid, int zCount)
Create a cube with its center at the origin, having edge length 2, with its corners at(±1, ±1, ±1), and with the top and bottom faces containing a triangle fan with the given number of triangles along each of the x, and z directions.There must be at least one triangle along the x and z directions.
- Parameters:
xCount- number of triangles along the x-directionyGrid- number of grid lines perpendicular to the y-axiszCount- number of triangles along the z-direction- Throws:
IllegalArgumentException- ifxCountis less than 1IllegalArgumentException- ifyGridis less than 0IllegalArgumentException- ifzCountis less than 1
-
-