DoVarTriangleMesh(3D)

NAME
DoVarTriangleMesh - Create a variable triangle mesh primitive object

SYNOPSIS
C:
DtObject DoVarTriangleMesh(colormodel, vertexcount,
		vertlocs, vertnorms, vertcolors,
		trianglecount, triangles, smoothflag)
DtColorModel colormodel;
DtInt vertexcount;
DtReal vertlocs[];
DtReal vertnorms[];
DtReal vertcolors[];
DtInt trianglecount;
DtInt triangles[];
DtFlag smoothflag;

FORTRAN:
INTEGER*4 DOVTRM(COLMOD, VTXCNT, VTXLOC,
		VTXNRM, VTXCLR, TRICNT,
		TRIS, SMOOFL)
INTEGER*4 COLMOD
INTEGER*4 VTXCNT
REAL*8 VTXLOC(*)
REAL*8 VTXNRM(*)
REAL*8 VTXCLR(*)
INTEGER*4 TRICNT
INTEGER*4 TRIS(3*TRICNT)
INTEGER*4 SMOOFL

DESCRIPTION
DoVarTriangleMesh creates a primitive object that defines a variable collection of triangles, normally interconnected.

The main difference between a variable triangle mesh and a triangle mesh is that a variable triangle mesh does not make a copy of the vertex data into its own data space. It simply maintains pointers to the vertex data (locations, normals and colors) in user space. A call to DpUpdVarTriangleMesh <DPUVTM> informs a variable triangle mesh object that the user data has changed.

The parameter colormodel specifies the color model used if vertex colors are provided. The parameter vertexcount specifies the total number of vertices in the mesh. The parameter vertlocs is an array of vertex locations. The parameter vertnorms is an array of vertex normals. If vertex normals are not available use DcNullPtr <DCNULL>. The parameter vertcolors is an array of vertex colors. If vertex colors are not available use DcNullPtr <DCNULL>.

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 of facet shading.

ERRORS
DoVarTriangleMesh must be called with at least three vertices.

[WARNING - invalid parameter]

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

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

SEE ALSO
DpUpdVarTriangleMesh(3D), DoTriangleMesh(3D), DoVarLineList(3D), DoVarPointList(3D), DoVarSimplePolygonMesh(3D), DoVarTriangleStrip(3D)