Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

DpUpdVarTriangleMesh(3D)

DoTriangleMesh(3D)

DoVarLineList(3D)

DoVarPointList(3D)

DoVarSimplePolygonMesh(3D)

DoVarTriangleMesh(3D)  —  Stardent Computer Inc. (\*(Dd)

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. 

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.  Variable triangle meshes are generally used to approximate a smooth surface. 

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).  If vertex normals are not available, or facet shading is specified, Doré computes geometric normals to calculate back-facing triangles for backface culling and incident and reflected light angles for 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 Doré. 

[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)

September 29, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026