Meshes
description
Transcript of Meshes
![Page 1: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/1.jpg)
Meshes
![Page 2: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/2.jpg)
Triangular Mesh (or mesh) A mesh is a set of adjacent triangles
facesvertices
edges
![Page 3: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/3.jpg)
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
![Page 4: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/4.jpg)
Topological properties of a mesh
Closed or open– When closed, each edge is shared by
exactly two faces
![Page 5: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/5.jpg)
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
![Page 6: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/6.jpg)
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
![Page 7: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/7.jpg)
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
![Page 8: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/8.jpg)
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
![Page 9: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/9.jpg)
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.
![Page 10: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/10.jpg)
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
![Page 11: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/11.jpg)
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
![Page 12: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/12.jpg)
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
![Page 13: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/13.jpg)
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
![Page 14: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/14.jpg)
More difficult tasks Compute a Bounding sphere Stripification Parametrize Automated simplification Detail recovery ...
![Page 15: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/15.jpg)
More difficult tasks Stripification
– Organize the triangles in triangle strips• As long as possible
![Page 16: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/16.jpg)
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
![Page 17: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/17.jpg)
More difficult tasks Automated simplification
• Parameters: A maximal error or a given number of faces
automatically
mesh semplificata2K triangles
mesh originale500K triangles
![Page 18: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/18.jpg)
Automated simplificationp e r f o r m a n c e
q u a l i t y
![Page 19: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/19.jpg)
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
![Page 20: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/20.jpg)
Detail preservation (or texture for geometry)
Idea:– Synthesize a texture– To compensate for the detail lost during
simplification
![Page 21: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/21.jpg)
500ktriangles
2ktriangles
Automatedsimplification
2k triangles, with texture mapping
rendering
Ad-hoc createdTEXTUREdetail
recovery
![Page 22: Meshes](https://reader035.fdocuments.us/reader035/viewer/2022070405/56813d0f550346895da6c5c9/html5/thumbnails/22.jpg)
simplified2K triangles
originale500K triangles
simplified but textured2K triangles