Meshes
Triangular Mesh (or mesh) A mesh is a set of adjacent triangles
facesvertices
edges
Topological properties of a mesh
Two Manifold or not– yes if each edge is shared by max 2 faces
• two manifold = good• not two manifold = bad• most algorithms on meshes assume it
is two-manifold
NOYES
Topological properties of a mesh
Closed or open– When closed, each edge is shared by
exactly two faces
Topological properties of a mesh
Coherent orientation– Is it possible to assign to each face an
orientation so that the overall assignment is coherent?
– Coherent orientation = coherent normals!A
1
23
1
23
Opposite direction, coherent edgeBC
D
How can we define a mesh?
A mesh is a set of adjacent triangles How can we define it? Direct way:
– An array of triangles– and for each triangle three vertices– and for each vertex three coordinate
How can we define a mesh? Indexed mode
– Ordered list of vertices• for each vertex its position
– Ordered list of faces• for each face, 3 indices to vertices
What about the attributes? Can be defined:
– per vertex• Define an attribute for each vertex
– per face• Define an attribute for each face
– per wedge (vertex of face)• Define three attributes for each face
Most common attributes:– color– Texture coordinates– Normals
Example: PLY format
Digital format for meshes Can be either binary, or ASCII (text)
– binary: more compact and easy to machine-read
– ascii: human-readable with a text-editor In both cases, it starts with an ASCII header.
cube.ply
Example: PLY format
ply
format ascii 1.0
comment a simple cube
element vertex 8
property float x
property float y
property float z
element face 12
property list uchar int vertex_indices
end_header
LetterL.off
Example: OFF format
1 5 10 5 14 3 2 1 04 5 4 3 04 6 7 8 94 6 9 10 114 0 1 7 64 1 2 8 74 2 3 9 84 3 4 10 94 4 5 11 104 5 0 6 11
OFF12 10 400 0 03 0 03 1 01 1 01 5 00 5 00 0 13 0 13 1 11 1 1
# vertices
# faces # edges
x,y,z2nd vertex
first face:4 vertices:with indices3, 2, 1 and 0
index 0
index 3
index 2index 1
Mesh: common tasks Given a mesh: compute the bounding box
– Very useful in many applications, e.g. collisions
– How to compute it?– We cycle on the vertices:
compute the max and the min of all x, y and z
Mesh: common tasks Given a mesh: compute the normals per
vertex– How?1 Set all the vertex normals to 0
2 cycle on each face:compute the normalnormalize itadd it to the vertex normal
3 cycle on each vertex:normalize the normal
More difficult tasks Compute a Bounding sphere Stripification Parametrize Automated simplification Detail recovery ...
More difficult tasks Stripification
– Organize the triangles in triangle strips• As long as possible
More difficult tasks Parameterization assign a pair of texture coordinates to each wedge When there are seams (lines appearing in two separate
images)– replicate the vertices– Save the texture coordinates for each wedge
v
More difficult tasks Automated simplification
• Parameters: A maximal error or a given number of faces
automatically
mesh semplificata2K triangles
mesh originale500K triangles
Automated simplificationp e r f o r m a n c e
q u a l i t y
Automated simplification
LOD 1 LOD 2 LOD 3 LOD 4
A hierarchy of Levels of Detail
To be used when viewer is
nearby
To be used when viewer is
far away
Detail preservation (or texture for geometry)
Idea:– Synthesize a texture– To compensate for the detail lost during
simplification
500ktriangles
2ktriangles
Automatedsimplification
2k triangles, with texture mapping
rendering
Ad-hoc createdTEXTUREdetail
recovery
simplified2K triangles
originale500K triangles
simplified but textured2K triangles