Docsity

3D Computer Graphics: Mesh Processing and Surface Representations - Prof. Timothy E. Mcgra, Study notes of Computer Science

Partial preview of the text

Download 3D Computer Graphics: Mesh Processing and Surface Representations - Prof. Timothy E. Mcgra and more Study notes Computer Science in PDF only on Docsity!

Mesh processing

 Surface representations

Data structures for triangle meshes

 Mesh subdivision

 Mesh simplification

Surface representations

 Unstructured point sets

Implicit

 Parametric

 (^) Piecewise polynomial (Splines)  (^) Piecewise planar (triangle meshes)

 Procedural

 (^) Constructive Solid Geometry (CSG)  (^) L-systems  (^) Shape grammars

Implicit surfaces

 Represented analytically

 (^) Sphere : x^2 + y^2 + z^2 – r^2 = 0  In general Ψ(x,y,z) = const. defines an isosurface. 

Or, represent as discretized samples

 Useful for morphing and blending surfaces

 Easy intersection tests.

Implicit surface rendering

Two options

 (^) Extract mesh  (^) Marching cubes  (^) Marching tetrahedra  (^) Define cells of adjacent voxels (8 voxels per cell for marching cubes)  (^) Determine surface intersection with each cell by linear interpolation  (^) Join intersection points with triangles (cases shown above)  (^) Volume rendering  (^) Design transfer function to visually extract isosurfaces.

Parametric splines

 Most surfaces are too complex to be modelled with a

single patch.

Patches can be joined smoothly by constraining the

derivatives to match at patch boundaries.

Parametric surfaces

 Can be compactly represented in terms of control points,

coefficients.

“Infinite zoom” : You can evaluate at more points to get a

smooth surface at any level of detail

 Easy to compute derivatives (tangent, bitangent, normal)

 Difficult intersection tests.

 Need multiple patches or high order equation for complex

models.

Structured meshes

 Doubly connected edge list (DCEL)

Half-edge data structure

 Supplied by external libraries

 (^) OpenMesh  (^) Computational Geometry Algorithms Library (CGAL)

Doubly-connected edge list (DCEL)

 Entities

 (^) Faces (not necessarily triangles)  (^) Half-edges  (^) Form counter-clockwise paths about faces  (^) Split each edge into an oppositely directed pair  (^) Vertices

 In a DCEL the half-edge is the

most important entity.

Doubly-connected edge list (DCEL)

 Now we can easily traverse a mesh...

 (^) List edges around a face  (^) Trivial since the edges form a linked-list  (^) firstedge = f1.halfedge;  (^) edge = firstedge;  (^) do  (^) list.append(edge);  (^) edge = edge.next;  (^) while (edge != firstedge) f1 f f3 f v1 v2 v v4 v5 v v7 v8 v

Doubly-connected edge list (DCEL)

 Now we can easily traverse a mesh...

 (^) List vertices around face (f1)  (^) firstedge = f1.halfedge;  (^) edge = firstedge;  (^) do  (^) list.append(edge.head);  (^) edge = edge.next;  (^) while (edge != firstedge)  (^) List faces around face  (^) firstedge = f1.halfedge;  (^) edge = firstedge;  (^) do  (^) if (edge.opposite != NULL)  (^) list.append(edge.opposite.face);  (^) edge = edge.next;  (^) while (edge != firstedge) f1 f f3 f v1 v2 v v4 v5 v v7 v8 v

Computing Properties using the DCEL

 The DCEL simplifies computation of several differential

properties

 Vertex normals

 (^) Traverse adjacent faces and accumulate face normals  (^) Recall : face normal can be computed using cross product.  (^) Normalize to get unit vector. n v n 1 n 2 n 3 n 4 n 5 nv =

i = 1 m n i

i = 1 m n i

Computing Properties using the DCEL

 Curvature

 (^) For parametric surfaces it is the rate of change of the normal vector  (^) A discrete approximation a point is given by

 What happens in these 2 extreme cases?

θ 1

i = 1 mi θ θ^2 3 θ 4 θ 5 θ 1 θ 2 θ 3 θ 4

1

2

3

4

As  n  0   2 

CSG

 Boolean operations applied to simple primitives

Commonly stored as a tree

      • =

L-systems

Generate shapes by string rewriting

Example : Sierpinski triangle

 (^) variables : A B  (^) constants : + −  (^) start : A  (^) rules : (A → B−A−B), (B → A+B+A)  (^) angle : 60°  (^) A,B are straight lines  (^) +,- are rotations by +/- angle