Package renderer.models_L
Class Cube2
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Cube2
-
public class Cube2 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 each face of the cube cut up by an n by m grid of 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 Cube2()Create a cube with its center at the origin, having edge length 2, with its corners at(±1, ±1, ±1).Cube2(int xGrid, int yGrid, int zGrid)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 the given number of grid lines parallel to the x, y, and z directions.
-
-
-
Constructor Detail
-
Cube2
public Cube2()
Create a cube with its center at the origin, having edge length 2, with its corners at(±1, ±1, ±1). and with two perpendicular grid lines going across the middle of each of the cube's faces.
-
Cube2
public Cube2(int xGrid, int yGrid, int zGrid)
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 the given number of grid lines parallel to the x, y, and z directions.- Parameters:
xGrid- number of grid lines perpendicular to the x-axisyGrid- number of grid lines perpendicular to the y-axiszGrid- number of grid lines perpendicular to the z-axis- Throws:
IllegalArgumentException- ifxGridis less than 0IllegalArgumentException- ifyGridis less than 0IllegalArgumentException- ifzGridis less than 0
-
-