NAME
hwTriangles - define one or more triangles
INHERITS FROM
hwSurface
hwOrient
PROPERTIES
Data *F The list of vertices (3 for each triangle), with
from 3 to 11 floats per vertex
OptLevel 1I The optimization level; see hw(3) for details
Indices *I (Optional) An array of indices which specifies
triads of vertex numbers to use in constructing
the triangles. If specified, must be a multiple
of 3 in length. Note that vertices are numbered
starting with 0.
DEFAULTS
OptLevel = HW_OPT_NONE
Data = NULL
DESCRIPTION
The hwTriangles class takes a list of vertices and displays them as
a number of closed polygonal surfaces. The Data pointer is an array
of hwFloat values; if Indices are not specified, then the number of
values must be equal to 3*n*FPV, where FPV is the number of hwFloats
present per vertex as described by the hwVertex man page. If Indicies
*is* specified, there's no constraint on the size of the Data array.
The number n is derived from the size of the Data array or Indices,
and is the number of triangles, each of which must have 3 vertices.
C EXAMPLE
/* Draw a square two-sided polygon, using two triangles */
hwObject
tris;
hwFloat
verts[] = {0,0,0, 0,1,0, 1,1,0,
1,1,0, 1,0,0, 0,0,0};
tris = hwTriangles->create( hwTriangles );
tris->modify( tris, hwStrData, HW_MAKE_TYPE(HW_TYPE_FLOAT,2*3*3), verts );
HW_MODIFY_1B( tris, hwStrTwoSided, HW_TRUE );
tris->draw( tris, disp );
tris->destroy( tris );
OBJECT FILE EXAMPLE
# A square two-sided polygon using two triangles
hwTriangles tris {
TwoSided = True
Data = {0,0,0, 0,1,0, 1,1,0,
1,1,0, 1,0,0, 0,0,0}
}
SEE ALSO
hw(3), hwSurface(3), hwOrient(3)