Geometric Processing CS 148: Summer 2016 Introduction of Graphics - - PowerPoint PPT Presentation

geometric processing
SMART_READER_LITE
LIVE PREVIEW

Geometric Processing CS 148: Summer 2016 Introduction of Graphics - - PowerPoint PPT Presentation

Geometric Processing CS 148: Summer 2016 Introduction of Graphics and Imaging Zahid Hossain https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29 Final Project Milestone 1: Get to the crux of the project by this milestone 5%


slide-1
SLIDE 1

CS 148: Summer 2016 Introduction of Graphics and Imaging Zahid Hossain

Geometric Processing

https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29

slide-2
SLIDE 2

Final Project

  • Milestone 1:
  • Get to the crux of the project by this milestone
  • 5% grade on the milestone (out of 20%) !
  • Very short writeup – mainly screenshot/images
  • Final Project Report
  • Due 12th Aug by 11:59PM.
  • Website (encouraged) or PDF

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 2

slide-3
SLIDE 3

Primitive for Rendering

Triangles

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 3

slide-4
SLIDE 4

Primitive for Rendering

Triangles

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4

slide-5
SLIDE 5

What Do We Want?

Higher-level representation of curves and surfaces that can generate triangles easily.

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 5

slide-6
SLIDE 6

Polygonal Mesh

  • Piecewise linear approximation of smooth surface
  • Error O(h2)
  • Efficient Rendering

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 6

slide-7
SLIDE 7

Triangle Mesh as Graph

A B C D E F G H I J K

G = graph = <V, E> V = vertices = {A, B, C, …, K} E = edges = {(AB), (AE), (CD), …} F = faces = {(ABE), (DHJG), …}

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 7

slide-8
SLIDE 8
  • Geometry: Vertex Positions
  • Connectivity: Edges, Triangles/Faces

Triangle Meshes

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 8

slide-9
SLIDE 9

Planar Graphs

Planar Graph Plane Graph Straight Line Plane Graph Planar Graph = Graph whose vertices and edges can be embedded in R2 such that its edges do not intersect

A B C D A B C D

A B C D

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 9

slide-10
SLIDE 10

Triangulation

Triangulation: Straight line plane graph where every face is a triangle.

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 10

slide-11
SLIDE 11

Graph Embedding

Embedding: G is embedded in Rd, if each vertex is assigned a position in Rd

Embedded in R2 Embedded in R3

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 11

slide-12
SLIDE 12

Vertex Degree/Valence

Vertex degree or valence = number of incident edges deg(A) = 4 deg(E) = 5 Regular mesh = all vertex degrees are equal

A B C D E F G H I J K

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 12

slide-13
SLIDE 13

Mesh Vocabulary

A B C D E I F L K J H G M

Mesh: straight-line graph embedded in R3 Boundary edge: adjacent to exactly one face Regular edge: adjacent to exactly two faces Singular edge: adjacent to more than two faces Closed mesh: mesh with no boundary edges

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 13

slide-14
SLIDE 14

Topology [tuh-pol-uh-jee]:

The study of geometric properties that remain invariant under certain transformations

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 14

slide-15
SLIDE 15

Topology and Geometry

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 15

Geometry: This vertex is at (x,y,z) Topology: These vertices are connected

slide-16
SLIDE 16

Global Topology: Genus

Genus: Half the maximal number of closed paths that do not disconnect the mesh (= the number of holes)

Genus 1 Genus 2 Genus 0

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 16

slide-17
SLIDE 17

Genus: Coffee Mug and Donut

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain

Both: Genus = 1

17

slide-18
SLIDE 18

Euler-Poincaré formula

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 18

slide-19
SLIDE 19

Euler-Poincaré formula

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 19

slide-20
SLIDE 20

Euler-Poincaré formula

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 20

slide-21
SLIDE 21

Special Case: Connected Planar Graph

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 21

Count the outer ”face” too

slide-22
SLIDE 22

Counting (Closed Mesh)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 22

slide-23
SLIDE 23

Counting (Closed Mesh)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 23

slide-24
SLIDE 24

Counting (Closed Mesh)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 24

Show that the average Degree/Valence of a large mesh is ~6 !

slide-25
SLIDE 25

Rasterize [rastərʌɪz]:

To convert vector data to raster format.

2D Manifold [rastərʌɪz]:

A 2D manifold is a surface that when cut with a small sphere, always yields a disk

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 25

Disc-like neighborhood

slide-26
SLIDE 26

Non-Manifold

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 26

slide-27
SLIDE 27

Properties of Manifold

  • A edge connects exactly two faces
  • An edge connects exactly two vertices
  • A face consists of a ring of edges and vertices
  • A vertex consists of a ring of edges and vertices

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 27

slide-28
SLIDE 28

Differential Geometry

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 28

Looks like a line Looks like a plane

slide-29
SLIDE 29

Mesh Data Structure

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 29

slide-30
SLIDE 30

Shared Vertices

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 30

Triangles (Vertex Indices) 2 1 … … … Vertex Coord List (10,5,20) (20,0,20) (18,10,20) …

slide-31
SLIDE 31

Shared Vertices

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 31

Triangles (Vertex Indices) 2 1 … … … Vertex Coord List (10,5,20) (20,0,20) (18,10,20) …

  • Connectivity
  • No neighborhood
  • Is v1 adjacent to v5 ?
  • Is f2 adjacent to f1 ?
  • Requires a full-pass over all faces
slide-32
SLIDE 32

Data Structure Requirement

  • What it should support ?
  • Geometric Inquires
  • What are the vertices of face #2 ?
  • Is vertex A adjacent to vertex H ?
  • Which faces are adjacent to face #1
  • Modifications
  • Add/remove a vertex/face
  • Vertex split, edge collapse

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 32

slide-33
SLIDE 33

Data Structure Requirement

  • What it should support ?
  • Geometric Inquires
  • What are the vertices of face #2 ?
  • Is vertex A adjacent to vertex H ?
  • Which faces are adjacent to face #1
  • Modifications
  • Add/remove a vertex/face
  • Vertex split, edge collapse

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 33

There are many data structures

slide-34
SLIDE 34

Halfedge Data Structure

  • Vertex Stores
  • Position
  • One outgoing halfedge (1)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 34

http://www.openmesh.org/Documentation/OpenMesh-Doc-Latest/a00016.html

slide-35
SLIDE 35

Halfedge Data Structure

  • A Face Stores
  • 1 halfedge bounding to it (2)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 35

http://www.openmesh.org/Documentation/OpenMesh-Doc-Latest/a00016.html

slide-36
SLIDE 36

Halfedge Data Structure

  • A halfedge stores
  • The vertex it points to (3)
  • The face is belongs to (4)
  • The next halfedge inside the face (5)
  • The opposite halfedge (6)
  • (optional) previous half edge in the face(7)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 36

http://www.openmesh.org/Documentation/OpenMesh-Doc-Latest/a00016.html

slide-37
SLIDE 37

Halfedge: Neighborhood Traversal

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 37

http://www.openmesh.org/media/Documentations/OpenMesh-2.0-Documentation/mesh_navigation.html

slide-38
SLIDE 38

Data Structure: Adjacency Matrix

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 38

  • Symmetric
  • 𝐵" #,%: # paths of length n from 𝑤# to 𝑤%
  • Related to Laplacian ( Put −deg

(𝑤#) in 𝐵(𝑗, 𝑗) ) for spectral analysis

  • Pros:
  • Can represent non-manifold meshes
  • Cons:
  • Non Connection between a vertex and its adjacent faces
slide-39
SLIDE 39

Subdivision

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 39

slide-40
SLIDE 40

Subdivision Surfaces

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 40

Mainly for mesh smoothing

slide-41
SLIDE 41

Subdivision Rules: 1D

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 41

Approximation Curve: Depends on the rule

slide-42
SLIDE 42

Chaikin’s Corner Cutting Method

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 42

slide-43
SLIDE 43

Chaikin’s Corner Cutting Method

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 43

http://www.idav.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm.pdf

slide-44
SLIDE 44

Chaikin’s Corner Cutting Method

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 44

1 2 3 n

http://www.idav.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm.pdf

slide-45
SLIDE 45

Extending to Surfaces

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 45

Triangle s Quads

slide-46
SLIDE 46

Extending to Surfaces

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 46

Triangles Quads Loop Subdivision Catmull-Clark Subdivision

slide-47
SLIDE 47

Loop Subdivision

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 47

slide-48
SLIDE 48

Loop Subdivision

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 48

Split one triangle into 4

slide-49
SLIDE 49

Loop Subdivision

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 49

Split further: one triangle into 4

slide-50
SLIDE 50

Loop Subdivision

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 50

Old Vertices New Vertices

slide-51
SLIDE 51

Loop Subdivision: New Vertex

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 51

Weights sums to 1

New vertex position: weighted average of the neighbors

slide-52
SLIDE 52

Loop Subdivision: Old Vertex

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 52

Updated position of old vertex weighted average of the neighboring “old” vertices

For valence: 6

slide-53
SLIDE 53

Loop Subdivision: Old Vertex

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 53

Weights sums to 1

Updated position of old vertex weighted average of the neighboring “old” vertices

For valence: 6

slide-54
SLIDE 54

Semi-Regular Mesh

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 54

Do we always have valence = 6 ?

Extraordinary Point

slide-55
SLIDE 55

Semi-Regular Mesh

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 55

Do we always have valence = 6 ?

Extraordinary Point

For sphere topology show valence is not 6 for all vertices Recall: Euler-Poincaré formula

slide-56
SLIDE 56

Loop Subdivision: Warren Weights

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 56

  • Challenge: find weights that generate a smooth surface (continuous tangent plane).
  • This is a complicated math problem

Warren Weights

slide-57
SLIDE 57

Loop Subdivision: At the Boundary

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 57

New Vertex Boundary

slide-58
SLIDE 58

Loop Subdivision: At the Boundary

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 58

New Vertex Old Vertex Boundary

slide-59
SLIDE 59

Loop Subdivision

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 59

Provable smoothness and regularities

slide-60
SLIDE 60

Laplacian Smoothing

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 60

slide-61
SLIDE 61

Laplacian Smoothing: 1D

An easier problem: How to smooth a curve?

pi = (xi , yi) pi-1 pi+1 pi-1 pi+1 pi = (xi , yi)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 61

slide-62
SLIDE 62

Laplacian Smoothing: 1D

An easier problem: How to smooth a curve?

pi = (xi , yi) pi-1 pi+1 pi-1 pi+1 pi = (xi , yi)

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 62

slide-63
SLIDE 63

Laplacian Smoothing: 1D

Update Rule: pi = (xi , yi) pi-1 pi+1

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 63

slide-64
SLIDE 64

Laplacian Smoothing

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 64

slide-65
SLIDE 65

Laplacian Smoothing

Recall: Adjacency Matrix for Mesh

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 65

slide-66
SLIDE 66

Laplacian Smoothing

Update Rule: Matrix Form of Update Rule

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 66

slide-67
SLIDE 67

Laplace Smoothing: Interpretation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 67

pk pl pm pn pi = (xi, yi, zi) pi = (xi , yi) pi-1 pi+1

1D Curve 2D Surface

slide-68
SLIDE 68

Laplace Smoothing: Interpretation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 68

pk pl pm pn pi = (xi, yi, zi) pi = (xi , yi) pi-1 pi+1

1D Curve 2D Surface

Note: Matrix formulation for 3D needs extra care: degree of vertices are not same everywere

slide-69
SLIDE 69

Laplace Smoothing: On Mesh

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 69

0 Iterations 5 Iterations 20 Iterations

slide-70
SLIDE 70

Laplace Smoothing: Problem

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 70

  • riginal

3 steps 6 steps 18 steps

  • riginal

Mesh shrinks !

slide-71
SLIDE 71

Laplace Smoothing: Problem

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 71

  • riginal

3 steps 6 steps 18 steps

  • riginal

Mesh shrinks !

slide-72
SLIDE 72

CS 148: Summer 2016 Introduction of Graphics and Imaging Zahid Hossain

Geometric Processing

https://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29