DoTriangleMesh(3D) — Stardent Computer Inc. (\*(Dd)
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.
Mesh objects allow the user to specify a collection of vertices in space and connect the vertices into a collection of other geometric entities, usually forming a connected surface. Triangle meshes are generally used to approximate a smooth 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. See the appendix on vertex types for more information on this parameter. 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). If no vertex normals are provided, or facet shading is specified, Doré computes geometric normals to find back-facing triangles for backface culling and incident and reflected light angles for 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 Doré.
[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), VertexTypes(3D)
September 29, 2021