Brain Dump

Polygon Mesh

Tags
computer-graphics

A way of representing 3d objectsusing a mesh of polygonal facets.

The alternative names refer to how we're representing the boundary of an object. We can't exactly represent a 3D Mesh, we only ever have an approximation.

The direction of a polygon (facing towards or away from the frame of reference) is determined using vertex-normals.

The most common kind of polygon used is a triangle because their always flat, you can't twist the vertices of a triangle (like you could with a square).

Storage Structures

Flat

We store a list of vertices where we chunk every [see page 5, 3 elements] as a polygon. In this structure there's no representation for shared edges or vertices, so data ends up being duplicated a lot. The order of vertices isn't really relevent, so long as you go anti-clockwise from the first vertex.

Warn: in this approach its inefficient to find polygons which share an edge.

We can commonly store this structure in a [see page 7, .obj] file.

Face Vertex

Alongside each vertex we store the list of polygons this vertex is part of. See [see page 8, here].

Note: The most widely used data structure for storing meshes.

Winged Edge

Each edge is [see page 10, stored] alongside it's 2 vertices, it's 4 neighbouring edges and the 2 polygons it separates.

Note: This is quick to find all the neighbours of a given vertex edge or polygon.

Warn: Has large storage requirements.

Hard Edges

Sometimes you may need to have multiple normals for the same vertex which has multiple edges. In this case you would duplicate the vertex in the data structure to give each edge it's own normal vector. See [see page 19, here]. Notice how the normal is being applied to the same vertex but in two different surfaces.