3d modeling - cs.princeton.edu

68
1 3D Modeling COS 426, Spring 2021 Princeton University Felix Heide

Upload: others

Post on 16-Oct-2021

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3D Modeling - cs.princeton.edu

1

3D Modeling

COS 426, Spring 2021

Princeton University

Felix Heide

Page 2: 3D Modeling - cs.princeton.edu

3

Syllabus

I. Image processing

II. Modeling

III. Rendering

IV. Animation

Image Processing(Rusty Coleman, CS426, Fall99)

Modeling(Denis Zorin, CalTech) Animation

(Angel, Plate 1)

Rendering(Michael Bostock, CS426, Fall99)

Page 3: 3D Modeling - cs.princeton.edu

4

What is 3D Modeling?

• Topics in computer graphics• Imaging = representing 2D images

• Modeling = representing 3D objects

• Rendering = constructing 2D images from 3D models

• Animation = simulating changes over time

Page 4: 3D Modeling - cs.princeton.edu

5

Modeling

• How do we ...• Represent 3D objects in a computer?

• Acquire computer representations of 3D objects?

• Manipulate these representations?

Stanford Graphics Laboratory H&B Figure 10.46

Page 5: 3D Modeling - cs.princeton.edu

6

Modeling Background

• Scene is usually approximated by 3D primitives• Point

• Vector

• Line segment

• Ray

• Line

• Plane

• Polygon

Page 6: 3D Modeling - cs.princeton.edu

7

3D Point

• Specifies a location• Represented by three coordinates

• Infinitely small

typedef struct {Coordinate x;Coordinate y;Coordinate z;

} Point; (x,y,z)

Origin

Page 7: 3D Modeling - cs.princeton.edu

8

3D Vector

• Specifies a direction and a magnitude• Represented by three coordinates

• Magnitude ||V|| = sqrt(dx dx + dy dy + dz dz)

• Has no location

typedef struct {Coordinate dx;Coordinate dy;Coordinate dz;

} Vector;

(dx,dy,dz)

Page 8: 3D Modeling - cs.princeton.edu

9

3D Vector

• Dot product of two 3D vectors• V1·V2 = ||V1 || || V2 || cos(Q)

(dx1,dy1,dz1)

(dx2,dy2 ,dz2)Q

Page 9: 3D Modeling - cs.princeton.edu

10

3D Orthogonality

• Dot product of two 3D vectors• V1·V2 = ||V1 || || V2 || cos(p/2) = 0

(dx1,dy1,dz1)

(dx2,dy2 ,dz2)90°

Page 10: 3D Modeling - cs.princeton.edu

11

3D Vector

• Cross product of two 3D vectors• V1xV2 = vector perpendicular to both V1 and V2

• ||V1xV2|| = ||V1 || || V2 || sin(Q)

(dx1,dy1,dz1)

(dx2,dy2 ,dz2)

V1xV2

Q

Page 11: 3D Modeling - cs.princeton.edu

12

3D Line Segment

• Linear path between two points• Parametric representation:

• P = P1 + t (P2 - P1), (0 t 1)

typedef struct {Point P1;Point P2;

} Segment;

P1

P2

Origin

Page 12: 3D Modeling - cs.princeton.edu

13

3D Ray

• Line segment with one endpoint at infinity• Parametric representation:

• P = P1 + t V, (0 <= t < )

typedef struct {Point P1;Vector V;

} Ray;

P1

V

Origin

Page 13: 3D Modeling - cs.princeton.edu

14

3D Line

• Line segment with both endpoints at infinity• Parametric representation:

• P = P1 + t V, (- < t < )

P1

typedef struct {Point P1;Vector V;

} Line;

V

Origin

Page 14: 3D Modeling - cs.princeton.edu

15Origin

3D Plane

• Defined by three points in 3D space

P1

P3P2

Page 15: 3D Modeling - cs.princeton.edu

16Origin

3D Plane

• A linear combination of three points• Implicit representation:

• P·N - d = 0, or

• N· (P – P1)= 0, or

• ax + by + cz + d = 0

• N is the plane “normal”• Unit-length vector

• Perpendicular to plane

typedef struct {Vector N;Distance d;

} Plane;

P1

N = (a,b,c)

d

P3P2

Page 16: 3D Modeling - cs.princeton.edu

17

3D Polygon

• Set of points “inside” a sequence of coplanar points

typedef struct {Point *points;int npoints;

} Polygon;

Points are in counter-clockwise order

Page 17: 3D Modeling - cs.princeton.edu

18

3D Object Representations

How can this object be represented in a computer?

Page 18: 3D Modeling - cs.princeton.edu

19

3D Object Representations

How about this one?

Page 19: 3D Modeling - cs.princeton.edu

20

3D Object Representations

This one?

Wallpapersonly.net

Page 20: 3D Modeling - cs.princeton.edu

21

3D Object Representations

This one?Solidworks

Page 21: 3D Modeling - cs.princeton.edu

22

3D Object Representations

This one? FumeFx

Page 22: 3D Modeling - cs.princeton.edu

23

3D Object Representations

• Points• Range image

• Point cloud

• Surfaces• Polygonal mesh

• Subdivision

• Parametric

• Implicit

• Solids• Voxels

• BSP tree

• CSG

• Sweep

• High-level structures• Scene graph

• Application specific

Page 23: 3D Modeling - cs.princeton.edu

24

Equivalence of Representations

• Thesis:• Each representation has enough expressive power

to model the shape of any geometric object

• It is possible to perform all geometric operations with any fundamental representation

• Analogous to Turing-equivalence• Computers and programming languages are

Turing-equivalent, but each has its benefits…

Page 24: 3D Modeling - cs.princeton.edu

25

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Animation

→ Data structures determine algorithms

Page 25: 3D Modeling - cs.princeton.edu

26

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Range Scanning

• Rendering

• Analysis

• Manipulation

• Animation

DGP course notes, Technion

Page 26: 3D Modeling - cs.princeton.edu

27

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Computer Vision

• Rendering

• Analysis

• Manipulation

• Animation

USCIndiana University

Page 27: 3D Modeling - cs.princeton.edu

28

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Tomography

• Rendering

• Analysis

• Manipulation

• Animation

DGP course notes, Technion

Page 28: 3D Modeling - cs.princeton.edu

29

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Intersection

• Analysis

• Manipulation

• Animation

Autodesk

Page 29: 3D Modeling - cs.princeton.edu

30

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Curvature,

smoothness

• Manipulation

• Animation

DGP course notes, Technion

Page 30: 3D Modeling - cs.princeton.edu

31

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Fairing

• Manipulation

• Animation

DGP course notes, Technion

Page 31: 3D Modeling - cs.princeton.edu

32

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Parametrization

• Manipulation

• Animation

DGP course notes, Technion

Page 32: 3D Modeling - cs.princeton.edu

33

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Texture mapping

• Manipulation

• Animation

DGP course notes, Technion

Page 33: 3D Modeling - cs.princeton.edu

34

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Reduction

• Manipulation

• Animation

DGP course notes, Technion

Page 34: 3D Modeling - cs.princeton.edu

35

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Structure

• Manipulation

• Animation

DGP course notes, Technion

Page 35: 3D Modeling - cs.princeton.edu

36

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Symmetry

detection

• Manipulation

• Animation

DGP course notes, Technion

Page 36: 3D Modeling - cs.princeton.edu

37

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Correspondence

• Manipulation

• Animation

DGP course notes, Technion

Page 37: 3D Modeling - cs.princeton.edu

38

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Shape

retrieval

• Manipulation

• Animation

Shao et al. 2011

Page 38: 3D Modeling - cs.princeton.edu

39

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Segmentation

• Manipulation

• Animation

DGP course notes, Technion

Page 39: 3D Modeling - cs.princeton.edu

40

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Composition

• Manipulation

• Animation

Lin et al. 2008

Page 40: 3D Modeling - cs.princeton.edu

41

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Deformation

• Animation

IGL

Page 41: 3D Modeling - cs.princeton.edu

42

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Deformation

• Animation

DGP course notes, Technion

Page 42: 3D Modeling - cs.princeton.edu

43

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Control

• Animation

Page 43: 3D Modeling - cs.princeton.edu

44

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Healing

• Animation

DGP course notes, Technion

Page 44: 3D Modeling - cs.princeton.edu

45

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Animation

• Rigging

Animation Buffet

Page 45: 3D Modeling - cs.princeton.edu

46

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Animation

• Deformation

transfer

Sumner et al. 2004

Page 46: 3D Modeling - cs.princeton.edu

47

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Animation

• Simulation

Physically Based Modelling course notes, USC

Page 47: 3D Modeling - cs.princeton.edu

48

Why Different Representations?

Efficiency for different tasks

• Acquisition

• Rendering

• Analysis

• Manipulation

• Animation

• Fabrication

DGP course notes, Technion

Page 48: 3D Modeling - cs.princeton.edu

49

3D Object Representations

• Points• Range image

• Point cloud

• Surfaces• Polygonal mesh

• Subdivision

• Parametric

• Implicit

• Solids• Voxels

• BSP tree

• CSG

• Sweep

• High-level structures• Scene graph

• Application specific

Page 49: 3D Modeling - cs.princeton.edu

50

3D Object Representations

• Points• Range image

• Point cloud

• Surfaces• Polygonal mesh

• Subdivision

• Parametric

• Implicit

• Solids• Voxels

• BSP tree

• CSG

• Sweep

• High-level structures• Scene graph

• Application specific

Page 50: 3D Modeling - cs.princeton.edu

51

Range Image

Set of 3D points mapping to pixels of depth image• Can be acquired from range scanner

Brian CurlessSIGGRAPH 99

Course #4 Notes

Range Image Tesselation Range Surface

Cyberware

Stanford

Page 51: 3D Modeling - cs.princeton.edu

52

Point Cloud

Unstructured set of 3D point samples• Acquired from range finder, computer vision, etc

Hoppe

HoppeMicroscribe-3D

Polhemus

Page 52: 3D Modeling - cs.princeton.edu

53

3D Object Representations

• Points• Range image

• Point cloud

• Surfaces• Polygonal mesh

• Subdivision

• Parametric

• Implicit

• Solids• Voxels

• BSP tree

• CSG

• Sweep

• High-level structures• Scene graph

• Application specific

Page 53: 3D Modeling - cs.princeton.edu

54

Polygonal Mesh

Connected set of polygons (often triangles)

Stanford Graphics Laboratory

Page 54: 3D Modeling - cs.princeton.edu

55

Subdivision Surface

Coarse mesh & subdivision rule• Smooth surface is limit of sequence of refinements

Zorin & SchroederSIGGRAPH 99 Course Notes

Page 55: 3D Modeling - cs.princeton.edu

56

Parametric Surface

Tensor-product spline patches• Each patch is parametric function

• Careful constraints to maintain continuity

FvDFH Figure 11.44

x = Fx(u,v)

y = Fy(u,v)

z = Fz(u,v)

uv

Page 56: 3D Modeling - cs.princeton.edu

57

Implicit Surface

Set of all points satisfying: F(x,y,z) = 0

Polygonal Model Implicit Model

Bill LorensenSIGGRAPH 99

Course #4 Notes

Page 57: 3D Modeling - cs.princeton.edu

58

3D Object Representations

• Points• Range image

• Point cloud

• Surfaces• Polygonal mesh

• Subdivision

• Parametric

• Implicit

• Solids• Voxels

• BSP tree

• CSG

• Sweep

• High-level structures• Scene graph

• Application specific

Page 58: 3D Modeling - cs.princeton.edu

59

FvDFH Figure 12.20

Voxel grid

Uniform volumetric grid of samples:• Occupancy

(object vs. empty space)

• Density

• Color

• Other function(speed, temperature, etc.)

• Often acquired viasimulation or fromCAT, MRI, etc.

Stanford Graphics Laboratory

Page 59: 3D Modeling - cs.princeton.edu

60

Octree

The adaptive version of the voxel grid• Significantly more space efficient

• Makes operations more cumbersome

Thomas Diewald

Page 60: 3D Modeling - cs.princeton.edu

61

BSP Tree

Hierarchical Binary Space Partition withsolid/empty cells labeled

• Constructed from polygonal representations

a

b

c

d

e

f

1

2

3

7

4

5

6

a

bc

de

f

g

Object

a

b

cde

f

1

2

3

4

5

6

7

Binary Spatial Partition

Binary Tree

Naylor

Page 61: 3D Modeling - cs.princeton.edu

62

CSG

Constructive Solid Geometry: set operations (union, difference, intersection) applied to simple shapes

FvDFH Figure 12.27 H&B Figure 9.9

Page 62: 3D Modeling - cs.princeton.edu

63

Sweep

Solid swept by curve along trajectory

Removal Path Sweep Model

Bill LorensenSIGGRAPH 99

Course #4 Notes

Page 63: 3D Modeling - cs.princeton.edu

64

3D Object Representations

• Points• Range image

• Point cloud

• Surfaces• Polygonal mesh

• Subdivision

• Parametric

• Implicit

• Solids• Voxels

• BSP tree

• CSG

• Sweep

• High-level structures• Scene graph

• Application specific

Page 64: 3D Modeling - cs.princeton.edu

65

Application Specific

Apo A-1(Theoretical Biophysics Group,

University of Illinois at Urbana-Champaign)

Architectural Floorplan(CS Building, Princeton University)

Page 65: 3D Modeling - cs.princeton.edu

66

Taxonomy of 3D Representations

Discrete Continuous

Combinatorial Functional

Parametric ImplicitTopological Set Membership

Voxels,Point sets

MeshSubdivision

BSP TreeCell Complex

BezierB-Spline

Algebraic

Naylor

3D Shape

Page 66: 3D Modeling - cs.princeton.edu

67

Equivalence of Representations

• Thesis:• Each representation has enough expressive power

to model the shape of any geometric object

• It is possible to perform all geometric operations with any fundamental representation

• Analogous to Turing-equivalence• Computers and programming languages are

Turing-equivalent, but each has its benefits…

Page 67: 3D Modeling - cs.princeton.edu

68

Computational Differences

• Efficiency• Representational complexity (e.g. surface vs. volume)• Computational complexity (e.g. O(n2) vs O(n3) )• Space/time trade-offs (e.g. tree data structures)• Numerical accuracy/stability (e.g. degree of polynomial)

• Simplicity• Ease of acquisition• Hardware acceleration• Software creation and maintenance

• Usability• Designer interface vs. computational engine

Page 68: 3D Modeling - cs.princeton.edu

69

Upcoming Lectures

• Points• Range image

• Point cloud

• Surfaces• Polygonal mesh

• Subdivision

• Parametric

• Implicit

• Solids• Voxels

• BSP tree

• CSG

• Sweep

• High-level structures• Scene graph

• Application specific