Unit content
Triangle meshes and indexed geometry
A triangle mesh approximates a surface using vertices connected into triangular faces.
Rather than storing three independent positions for every triangle, an indexed mesh stores a vertex array once and represents each face by indices into that array. Neighboring triangles can therefore share positions and other per-vertex data.
A mesh separates geometry from attributes. A vertex may carry a position, normal, texture coordinates, color or other values used by later rendering stages.
Triangles are especially useful because three non-collinear points define a planar primitive, intersection and interpolation are well understood, and complex surfaces can be tessellated into many triangles.
The same geometric surface can have different mesh connectivity. Duplicating a position may be intentional when adjacent faces need discontinuous attributes such as a sharp normal or texture seam.
A triangle mesh is therefore both a geometric approximation and a data structure whose indexing and connectivity affect rendering and processing.