public class Torus extends Shape3D
TOLERANCE (currently 0.00001) are forced to exactly 0.0.
Note that texture coordinates are assigned from 0.0 to 1.0 around the rings
in both the S and T direction; this causes texture-mapped images to be
stretched completely around the torus in both directions.| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_INNER_RADIUS
The default inner radius; that is, the distance from the center of
the torus to the middle of one of the outer rings.
|
static double |
DEFAULT_OUTER_RADIUS
The default outer radius; that is, one-half the ring diameter.
|
static int |
DEFAULT_PRECISION
The default Torus precision -- that is, the number of vertices
around either circumference.
|
static double |
TOLERANCE |
| Constructor and Description |
|---|
Torus()
Constructs a Torus with default size and precision values.
|
Torus(float inner,
float outer,
int precision)
Constructs a Torus with the specified inner and outer radii and
the specified precision.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
getIndices()
Returns an array of indexes into the array returned by
getVertices();
each three index values define the vertices of a single triangle of the Torus. |
Vertex3D[] |
getVertices()
Returns an array of
Vertex3Ds defining this Torus. |
clone, getName, getRotation, getScale, getTransform, getTranslation, rotate, rotate, scale, setName, setRotation, setScale, setTranslation, translatepublic static final int DEFAULT_PRECISION
public static final double DEFAULT_INNER_RADIUS
public static final double DEFAULT_OUTER_RADIUS
public static final double TOLERANCE
public Torus()
public Torus(float inner,
float outer,
int precision)
public Vertex3D[] getVertices()
Vertex3Ds defining this Torus. Note that the order
of the vertices in the returned array is not necessarily meaningful; that is,
adjacent vertices in the array are not necessarily related in the structure of
the Torus object. To determine the relationships between vertices,
call method getIndices(), which identifies sets of three vertices
defining the triangles making up the Torus.public int[] getIndices()
getVertices();
each three index values define the vertices of a single triangle of the Torus.