Vertices have position, normal, colour, texture coordinates, etc.
Stanford bunny
Surface is
from Blender | from 3dsMax |
Rendered as a small disk, with lighting
Image from "Interpolatory Refinement for Real-Time Processing of Point-Based Geometry" by Guennebaud, Barthe, and Paulin, EuroGraphics 2005
Image mesh from hal.inria.fr/inria-00417371
Image from wikipedia.org
A 3D array of scalar values
From cabiatl.com/mricro/mricro/render
List of vertices: $v_0, v_1, v_2, \ldots$
List of faces: $f_0, f_1, f_2, \ldots$
$v_i$ has position $(x,y,z)$, normal $(n_x, n_y, n_z)$, colour $(r,g,b)$, texture coordinates $(s,t)$.
$f_i$ has vertices $v_{i_0}, v_{i_1}, v_{i_2}$ and normal $n$.
Render by (slowly) iterating through all faces.
Good for topological queries (e.g. what faces are adjace to a vertex, what edges are around a face (in order)).
Edges are unidirectional.
Each edge $e_L$ stores pointers to:
$v_T$ | tail vertex |
$e_R$ | twin edge in other direction |
$f_L$ | face to left of edge |
$e_{ccw}$ | next outgoing edge counterclockwise at tail vertex |
Each face $f$ stores a pointer to any adjacent edge.
Each vertex $v$ stores a pointer to any adjacent outgoing edge.
head(e) = e.twinEdge.tailVertex
right(e) = e.twinEdge.leftFace
adjacentFaces(v)
adjacentEdges(v)
adjacentEdges(f)
adjacentVertices(f)
E.g. Collapse edge $e$
Rendering $n$ triangles using "triangle soup" processes $3n$ vertices.
Using $k$ triangle strips for the same $n$ triangles processes $n + 2k$ vertices: $2$ to start the strip plus $1$ more for each triangle on the strip.
Covering a triangle mesh with a minimum number of strips is NP-hard.
To render, openGL needs to know whether the next triangle is to the right or the left exit from the current triangle:
Option 1: Add a bit to indicate left or right.
Option 2: Assume alternating left, then right, then left, etc.: Sequence is $v_0, v_1, v_2, \ldots, v_9$.
Option 3: Add empty triangles: Sequence is $v_0, v_1, v_2, \ldots, v_7$.