Package renderer.models_L
Class Cube3
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Cube
-
- renderer.models_L.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)
-
-
Field Summary
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description Cube3()Create a cube with its center at the origin, having edge length 2, with its corners at(±1, ±1, ±1).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.
-
-
-
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-directionyCount- number of triangles along the y-directionzCount- number of triangles along the z-direction- Throws:
IllegalArgumentException- ifxCountis less than 1IllegalArgumentException- ifyCountis less than 1IllegalArgumentException- ifzCountis less than 1
-
-