02 basics 2 - computer graphics at stanford...
TRANSCRIPT
![Page 1: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/1.jpg)
Basic ConceptsBasic ConceptsBasic ConceptsBasic Concepts
![Page 2: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/2.jpg)
TodayToday
• Mesh basicsMesh basics– Zoo
Definitions– Definitions
– Important properties
• Mesh data structures
• HW1
![Page 3: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/3.jpg)
Polygonal Meshes
• Piecewise linear approximation
Polygonal Meshes
Piecewise linear approximation– Error is O(h2)
3 6 12 24
25% 6.5% 1.7% 0.4%
![Page 4: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/4.jpg)
Polygonal MeshesPolygonal Meshes
• Polygonal meshes are a good representation
– approximation O(h2)approximation O(h )
– arbitrary topology
– piecewise smooth surfaces
d ti fi t– adaptive refinement
– efficient rendering
![Page 5: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/5.jpg)
Triangle Meshes
• Connectivity: vertices edges triangles
Triangle Meshes
Connectivity: vertices, edges, triangles
• Geometry: vertex positionsGeometry: vertex positions
![Page 6: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/6.jpg)
Mesh ZooMesh Zoo
Single component,closed, triangular, orientable manifold
With boundaries Not orientable
Multiple components Not only triangles Non manifold
![Page 7: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/7.jpg)
Mesh DefinitionsMesh Definitions
• Need vocabulary to describe zoo meshes
• The connectivity of a mesh is just a graph
• We’ll start with some graph theoryWe ll start with some graph theory
![Page 8: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/8.jpg)
Graph DefinitionsGraph Definitions
AB
G = graph = <V E>
C DE
F
G graph <V, E>
V = vertices = {A, B, C, …, K}
E edges {(AB) (AE) (CD) }
GH I
E = edges = {(AB), (AE), (CD), …}
F = faces = {(ABE), (DHJG), …}
J K
![Page 9: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/9.jpg)
Graph DefinitionsGraph Definitions
Vertex degreeVertex degree or valence valence =number of incident edges
AB
deg(A) = 4
deg(E) = 5C DE
F
Regular mesh =Regular mesh =GH I
Regular mesh Regular mesh
all vertex degrees are equalJ K
![Page 10: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/10.jpg)
ConnectivityConnectivity
ConnectedConnected =
AB
path of edges connecting every two vertices
C DE
F
GH I
J K
![Page 11: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/11.jpg)
ConnectivityConnectivity
ConnectedConnected =
AB
path of edges connecting every two vertices
C DE
F SubgraphSubgraph =
G’=<V’,E’> is a subgraph of G=<V,E> if
GH I
G V ,E is a subgraph of G V,E if
V’ is a subset of V and
E’ is the subset of E incident on V
J K
E is the subset of E incident on V
![Page 12: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/12.jpg)
ConnectivityConnectivity
ConnectedConnected =
AB
path of edges connecting every two vertices
C DE
F SubgraphSubgraph =
G’=<V’,E’> is a subgraph of G=<V,E> if
GH I
G V ,E is a subgraph of G V,E if
V’ is a subset of V and
E’ is a subset of E incident on V’
J K
E is a subset of E incident on V
![Page 13: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/13.jpg)
ConnectivityConnectivity
ConnectedConnected =
path of edges connecting every two vertices
SubgraphSubgraph =
G’=<V’,E’> is a subgraph of G=<V,E> ifG V ,E is a subgraph of G V,E if
V’ is a subset of V and
E’ is the subset of E incident on VE is the subset of E incident on V
Connected Component =Connected Component =
ll d b hmaximally connected subgraph
![Page 14: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/14.jpg)
Graph EmbeddingGraph EmbeddingEmbeddingEmbedding: : G is embedded in d, if each vertex
d dis assigned a position in d
Embedded in 2 Embedded in 3
![Page 15: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/15.jpg)
Planar GraphsPlanar GraphsPlanar Graph Planar Graph =
Graph whose vertices and edges can be embedded in R2 such that
its edges do not intersect
PlanarPlanar Graph PlanePlane Graph Straight Line Straight Line Plane Graph
its edges do not intersect
B BB
AC
DA
DA
D
CC
C
![Page 16: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/16.jpg)
TriangulationTriangulation
Triangulation:
i h li l h hStraight line plane graph where every face is a triangle.
![Page 17: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/17.jpg)
MeshMeshMesh:
straight‐line graph embedded in R3
A
B C BoundaryBoundary edgeedge: : adjacent to exactly one faceA
D
I
LJ M adjacent to exactly one face
RegularRegular edge: edge:
E
F
KH
G
adjacent to exactly two faces
SingularSingular edgeedge::G SingularSingular edgeedge::adjacent to more than two faces
l d hl d hClosed mesh: Closed mesh: mesh with no boundary edges
![Page 18: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/18.jpg)
2‐Manifolds Meshes2 Manifolds Meshes
Disk‐shaped neighborhoods
• implicitsurface of a “physical” solid– surface of a “physical” solid
–f ldnon‐manifolds
![Page 19: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/19.jpg)
Global Topology: GenusGlobal Topology: Genus
GenusGenus: : Half the maximal number of closed paths that do not disconnect
the mesh (= the number of holes)
Genus 1 Genus 2Genus 0 Genus ?
![Page 20: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/20.jpg)
Closed 2‐Manifold Polygonal Meshes
Euler‐Poincaré formula
Euler characteristicEuler characteristic
V = 8E = 12
V = 3890E = 11664
F = 6χ = 8 + 6 – 12 = 22
F = 7776χ = 22
![Page 21: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/21.jpg)
Closed 2‐Manifold Polygonal Meshes
Euler‐Poincaré formula
V = 1500, E = 4500F = 3000, g = 1
00
g = 2χ = --22
χ = 00
![Page 22: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/22.jpg)
Closed 2‐Manifold Triangle Meshes
• Trianglemesh statisticsg
• Avg. valence ≈ 6Show using Euler Formula
• When can a closed triangle mesh be 6‐regular?
![Page 23: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/23.jpg)
ExerciseExercise
Theorem: Average vertex degree in closed manifold triangle mesh is ~6
Proof: In such a mesh 3F = 2E by counting edges of facesProof: In such a mesh, 3F = 2E by counting edges of faces.
By Euler’s formula: V+F-E = V+2E/3-E = 2-2g.Thus E = 3(V-2+2g)
So Average(deg) = 2E/V = 6(V-2+2g)/V ~ 6 for large V
Corollary: Only toroidal (g=1) closed manifoldCorollary: Only toroidal (g 1) closed manifold triangle mesh can be regular (all vertex degrees are 6)
Proof: In regular mesh average degree is e actl 6exactly 6.Can happen only if g=1
![Page 24: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/24.jpg)
RegularityRegularity
• semi‐regularsemi regular
![Page 25: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/25.jpg)
OrientabilityOrientability
F O i t tiF O i t ti
B
Face Orientation =Face Orientation =clockwise or anticlockwise order in
which the vertices listed D
defines direction of face normalnormal
A
C
Oriented CCW: {(C,D,AD,A), (A,DA,D,B), (C,B,D)}
Oriented CW: {(C,A,D), (D,A,B), (B,C,D)}
![Page 26: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/26.jpg)
OrientabilityOrientability
F O i t tiF O i t ti
B
Face Orientation =Face Orientation =clockwise or anticlockwise order in
which the vertices listed D
defines direction of face normalnormal
A
C
Oriented CCW: {(C,D,A), (A,D,B), (C,B,D)}
Oriented CW: {(C,A,DA,D), (D,AD,A,B), (B,C,D)}
Not oriented:{(C,D,A), (D,A,B), (C,B,D)}
![Page 27: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/27.jpg)
OrientabilityOrientability
F O i t tiF O i t ti
B
Face Orientation =Face Orientation =clockwise or anticlockwise order in
which the vertices listed D
defines direction of face normalnormal
A
C
Orientable Plane Graph Orientable Plane Graph = Oriented CCW: {(C,D,A), (A,D,B), (C,B,D)}
orientations of faces can be chosen so that each non‐boundary edge is
oriented in both directions
Oriented CW: {(C,A,D), (D,A,B), (B,C,D)}
oriented in both directionsNot oriented:{(C,D,AD,A), (D,AD,A,B), (C,B,D)}
![Page 28: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/28.jpg)
Non‐Orientable SurfacesNon Orientable Surfaces
Mobius Strip Klein Bottle
![Page 29: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/29.jpg)
Garden Variety Klein BottlesGarden Variety Klein Bottles
http://www.kleinbottle.com/
![Page 30: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/30.jpg)
SmoothnessSmoothness
• Position continuity = C0Position continuity = C
![Page 31: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/31.jpg)
SmoothnessSmoothness
• Position continuity = C0Position continuity = C
• Tangent continuity ≈ C1
![Page 32: 02 Basics 2 - Computer Graphics at Stanford Universitygraphics.stanford.edu/.../LectureSlides/02_Basics.pdfEE ’ is the subset of EE incident on VV Connected Component = maximally](https://reader031.vdocuments.us/reader031/viewer/2022022008/5adad24e7f8b9aee348d476a/html5/thumbnails/32.jpg)
SmoothnessSmoothness
• Position continuity = C0Position continuity = C
• Tangent continuity ≈ C1
C i i C2• Curvature continuity ≈ C2