public class Cube3 extends Cube
(±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.
v[4]
+-----------------+ v[5]
/| /|
/ | / |
/ | / |
/ | / |
v[7] +-----------------+ v[6] |
| | | | y
| | | | |
| | | | |
| v[0] +---------|-------+ v[1] |
| / | / |
| / | / +----. x
| / | / /
|/ |/ /
+-----------------+ /
v[3] v[2] z
lineSegmentList, vertexList, visible
Constructor and 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. |
addLineSegment, addLineSegment, addVertex, setColor, setColorRandom, setRandomColors, setRandomLineSegmentColors, toString
public Cube3()
(±1, ±1, ±1)
. and
with a triangle fan of four triangles in each face.public Cube3(int xCount, int yCount, int zCount)
(±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.
xCount
- number of triangles along the x-directionyCount
- number of triangles along the y-directionzCount
- number of triangles along the z-direction