DoTriangleMesh(3D)

NAME
DoTriangleMesh - Create a triangle mesh primitive object

SYNOPSIS
C:
DtObject DoTriangleMesh(colormodel, vertextype,
	vertexcount, vertices, trianglecount,
	triangles, smoothflag)
DtColorModel colormodel;
DtVertexType vertextype;
DtInt vertexcount;
DtReal vertices[];
DtInt trianglecount;
DtInt triangles[];
DtFlag smoothflag;

FORTRAN:
INTEGER*4 DOTRIM(COLMOD, VTXTYP, VTXCNT,
		VTXS, TRICNT, TRIS,
			SMOOFL)
INTEGER*4 COLMOD
INTEGER*4 VTXTYP
INTEGER*4 VTXCNT
REAL*8 VTXS(*)
INTEGER*4 TRICNT
INTEGER*4 TRIS(*)
INTEGER*4 SMOOFL

DESCRIPTION
DoTriangleMesh creates a triangle mesh primitive object that defines a collection of triangles, normally interconnected.

With a triangle mesh, you specify a collection of vertices in space and connect the vertices into a collection of triangles, usually forming a connected surface.

The parameter colormodel specifies the color model used if the vertices contain color information for shading purposes. The parameter vertextype specifies the exact nature of the vertices. for more information, refer to Chapter 6, Dore Vertex Types, in the Dore Reference Manual or to the VertexTypes on-line manual page.) The parameter vertexcount specifies the total number of vertices in the mesh. The parameter vertices is an array of vertex data. The parameter trianglecount specifies the total number of triangles in the mesh. The parameter triangles is a one-dimensional array containing trianglecount triplets of integers. Each triplet is an ordered list of mesh vertex numbers for the three coordinates of the triangle.

If vertex normals are not provided, the parameter smoothflag specifies that the vertex normal for shading purposes will be the average of the geometric normals from a vertex's adjacent surfaces. This assumes that the triangle mesh defines a smooth surface.

The geometric normal to each triangle is calculated using the right-hand rule (when the fingers of the right hand point in the order of the vertices, the thumb points in the direction of the normal). These normals are sometimes used for backface culling and facet shading.

ERRORS
DoTriangleMesh must be called with at least three vertices.

[WARNING - invalid parameter]

DoTriangleMesh will issue an warning if a zero vertex normal is calculated by Dore.

[WARNING - triangle normals sum to 0 at vertex, check for back to back triangles]

DoTriangleMesh will fail if an invalid vertex list pointer is specified.

[WARNING - value out of range]

SEE ALSO
DoPolygon(3D), DoPolygonMesh(3D), DoSimplePolygon(3D), DoSimplePolygonMesh(3D), DoTriangleList(3D), DoTriangleStrip(3D), VertexTypes(3D)