32
Basic Concepts Basic Concepts Basic Concepts Basic Concepts

Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Basic ConceptsBasic ConceptsBasic ConceptsBasic Concepts

Page 2: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

TodayToday

• Mesh basicsMesh basics– Zoo

Definitions– Definitions

– Important properties

• Mesh data structures

• HW1

2

Page 3: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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%

3

Page 4: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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

4

Page 5: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Triangle Meshes

• Connectivity: vertices edges triangles

Triangle Meshes

Connectivity: vertices, edges, triangles

• Geometry: vertex positionsGeometry: vertex positions

5

Page 6: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Mesh ZooMesh Zoo

Single component,closed, triangular,

orientable manifold

With boundaries Not orientable

Multiple components Not only triangles Non manifold

6

Page 7: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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

7

Page 8: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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

8

Page 9: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Graph DefinitionsGraph Definitions

Vertex degreeVertex degree or valence valence =number of incident edges

AB

deg(A) = 4

deg(E) = 5C D

EF

Regular mesh =Regular mesh =GH I

Regular mesh Regular mesh

all vertex degrees are equalJ K

9

Page 10: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

ConnectivityConnectivity

ConnectedConnected =

AB

path of edges connecting every two vertices

C DE

F

GH I

J K

10

Page 11: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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

11

Page 12: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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

12

Page 13: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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

13

Page 14: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Graph EmbeddingGraph EmbeddingEmbeddingEmbedding: : G is embedded in Rd, if each vertex

dis assigned a position in Rd

Embedded in R2 Embedded in R3

14

Page 15: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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 15

Page 16: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

TriangulationTriangulation

Triangulation:

i h li l h hStraight line plane graph where every face is a triangle.

16

Page 17: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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

17

Page 18: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

2-Manifold Meshes2 Manifold Meshes

Disk-shaped neighborhoods

• implicitsurface of a “physical” solid– surface of a “physical” solid

–f ldnon-manifolds

18

Page 19: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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 ?

19

Page 20: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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 20

Page 21: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Closed 2-Manifold Polygonal Meshes

Euler-Poincaré formula

V = 1500, E = 4500F = 3000, g = 1

00

g = 2χ = --22

χ = 0021

Page 22: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Closed 2-Manifold Triangle Meshes

• Triangle mesh statisticsg

• Avg. valence ≈ 6Show using Euler Formula

• When can a closed triangle mesh be 6-regular?

22

Page 23: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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

23

Page 24: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

RegularityRegularity

• semi-regularsemi regular

24

Page 25: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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)}

25

Page 26: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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)}

26

Page 27: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

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)}

27

Page 28: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Non-Orientable SurfacesNon Orientable Surfaces

Mobius Strip Klein Bottle

28

Page 29: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

Garden Variety Klein BottlesGarden Variety Klein Bottles

http://www.kleinbottle.com/http://andrewlipson.com/kleinbottle.htm 29

Page 30: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

SmoothnessSmoothness

• Position continuity = C0Position continuity = C

30

Page 31: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

SmoothnessSmoothness

• Position continuity = C0Position continuity = C

• Tangent continuity ≈ C1

31

Page 32: Basic ConceptsBasic Concepts - Computer graphicsgraphics.stanford.edu/courses/cs468-12-spring/LectureSlides/02_Basics.pdf · Planar Graph Plane Graph Straight Line Plane Graph its

SmoothnessSmoothness

• Position continuity = C0Position continuity = C

• Tangent continuity ≈ C1

C i i C2• Curvature continuity ≈ C2

32