Top Banner
CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica Hodgins V2005-14-1.1
56

CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

Dec 18, 2015

Download

Documents

Della Logan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

CS-378: Game Technology

Lecture #5: Curves and Surfaces

Prof. Okan ArikanUniversity of Texas, Austin

Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica Hodgins

V2005-14-1.1

Page 2: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

22

Administrative

Final ProjectFirst deliverable

Homework is out

Page 3: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

33

Today

General curve and surface representations

Splines and other polynomial bases

Points

Page 4: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

44

Geometry Representations

Constructive Solid Geometry (CSG)Parametric

Polygons

Subdivision surfaces

Implicit SurfacesPoint-based Surface

Page 5: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

55

Geometry Representations

Object made by CSGConverted to polygons

Page 6: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

66

Geometry Representations

Object made by CSGConverted to polygonsConverted to implicit surface

Page 7: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

77

Geometry Representations

CSG on implicit surfaces

Page 8: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

88

Geometry Representations

Point-based surface descriptions

Ohtake, et al., SIGGRAPH 2003

Page 9: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

99

Geometry Representations

Subdivision surface(different levels of refinement)

Images from Subdivision.org

Page 10: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1010

Geometry Representations

Various strengths and weaknessesEase of use for design

Ease/speed for rendering

Simplicity

Smoothness

Collision detection

Flexibility (in more than one sense)

Suitability for simulation

many others...

Page 11: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1111

Parametric Representations

Curves:

Surfaces:

Volumes:

and so on...

Note: a vector function is really n scalar functions

Page 12: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1212

Same curve/surface may have multiple formulae

Parametric Rep. Non-unique

Page 13: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1313

Simple Differential Geometry

Tangent to curve

Tangents to surface

Normal of surface

Also: curvature, curve normals, curve bi-normal, others...Degeneracies: or

Page 14: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1414

Discretization

Arbitrary curves have an uncountable number of parameters

i.e. specify function value at all points on real number line

Page 15: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1515

Discretization

Arbitrary curves have an uncountable number of parameters

Pick complete set of basis functions

Polynomials, Fourier series, etc.

Truncate set at some reasonable point

Function represented by the vector (list) of

The may themselves be vectors

Page 16: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1616

Polynomial Basis

Power Basis

The elements of are linearly independant

i.e. no good approximation

Skipping something would lead to bad results... odd stiffness

Page 17: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1717

Specifying a Curve

Given desired values (constraints) how do we determine the coefficients for cubic power basis?

For now, assume

Page 18: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1818

Specifying a Curve

Given desired values (constraints) how do we determine the coefficients for cubic power basis?

Page 19: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

1919

Specifying a Curve

Given desired values (constraints) how do we determine the coefficients for cubic power basis?

Page 20: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2020

Specifying a Curve

Given desired values (constraints) how do we determine the coefficients for cubic power basis?

Page 21: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2121

Specifying a Curve

Given desired values (constraints) how do we determine the coefficients for cubic power basis?

Page 22: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2222

Specifying a Curve

Given desired values (constraints) how do we determine the coefficients for cubic power basis?

Hermite basis functions

Page 23: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2323

Specifying a Curve

Given desired values (constraints) how do we determine the coefficients for cubic power basis?

Hermite basis functions

Probably not to scale.

Page 24: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2424

Hermite Basis

Specify curve by Endpoint values

Endpoint tangents (derivatives)

Parameter interval is arbitrary (most times)

Don’t need to recompute basis functions

These are cubic HermiteCould do construction for any odd degree

derivatives at end points

Page 25: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2525

Cubic Bézier

Similar to Hermite, but specify tangents indirectly

Note: all the control points are points in space, no tangents.

Page 26: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2626

Cubic Bézier

Similar to Hermite, but specify tangents indirectly

Page 27: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2727

Cubic Bézier

Plot of Bézier basis functions

Page 28: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2828

Changing Bases

Power basis, Hermite, and Bézier all are still just cubic polynomials

The three bases all span the same space

Like different axes in

Changing basis

Page 29: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

2929

Useful Properties of a Basis

Convex HullAll points on curve inside convex hull of control points

Bézier basis has convex hull property

Page 30: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3030

Useful Properties of a Basis

Invariance under class of transforms

Transforming curve is same as transforming control points

Bézier basis invariant for affine transforms

Bézier basis NOT invariant for perspective transforms

NURBS are though...

Page 31: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3131

Useful Properties of a Basis

Local supportChanging one control point has limited impact on entire curve

Nice subdivision rules

Fast evaluation scheme

Interpolation -vs- approximation

Page 32: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3232

DeCasteljau Evaluation

A geometric evaluation scheme for Bézier

Page 33: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3333

Joining

If you change a, b, or c you must change the others

But if you change a, b, or c you do not have to change beyond those three. *Local Support*

Page 34: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3434

Tensor-Product Surfaces

Surface is a curve swept through space

Replace control points of curve with other curves

Page 35: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3535

Hermite Surface Bases

Plus symmetries...

Page 36: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3636

Hermite Surface Hump Functions

Plus symmetries...

Page 37: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

Points

Page 38: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3838

A Thought ExperimentLaser scanners Millions to billions of points

Typical imageAt most a few million pixels

More points than pixels...

Page 39: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

3939

“Point-Based Graphics”

Surfaces represented only by pointsMaybe normals also

No topology

How can we doRendering

Modeling opperations

Simulation

Page 40: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4040

Rendering

For each point draw a little “splat” Use associated normal for shading

Possibly apply texture

If “splats” are small compared to spacing then gaps result

Ohtake, et al., SIGGRAPH 2003

Splatting too many points wouldwaste time

Page 41: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4141

Rendering

“QSplat” algorithm Build hierarchical tree of the pointsUse bounding spheres to estimate size of clustersRender clusters based on screen sizeUse cluster-normals for internal nodes

From Rusinkiewicz and Levoy, SIGGRAPH 2000.

Page 42: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4242

Rendering

From Rusinkiewicz and Levoy, SIGGRAPH 2000.

Page 43: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4343

Rendering

From Rusinkiewicz and Levoy, SIGGRAPH 2000.

Page 44: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4444

Rendering

From Rusinkiewicz and Levoy, SIGGRAPH 2000.

Page 45: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4545

Rendering

From Rusinkiewicz and Levoy, SIGGRAPH 2000.

Page 46: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4646

Defining a Surface

Two related methodsSurface is a point attractor

Point-set surfaces

Implicit surface

Multi-level Partition of Unity Implicits

Implicit Moving Least-Squares

Page 47: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4747

Point-Set Surfaces

Surface is the attractor of a repeated projection processFind nearby points

Fit plane (weighted)

Project into plane

Repeat

Does it converge?How to weight points?

From Amenta and Kil, SIGGRAPH 2004.

Page 48: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4848

Implicit Moving Lest-Squares

Define a scalar function that is zero passing through all the points

From Shen, et al., SIGGRAPH, 2004.

Page 49: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

4949

Implicit Moving Lest-Squares

From Shen, et al., SIGGRAPH, 2004.

Function is zero on boundaryDecreases in outward direction

Page 50: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

5050

Moving Least-Square Interpolation

Standard Least SquareStandard Least Square

Page 51: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

5151

Moving Least-Square Interpolation

Moving Least SquareMoving Least Square

Page 52: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

5252

Moving Least-Square Interpolation

Least Square Moving Least Square

InterpolatingInterpolating

ApproximatingApproximating

Page 53: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

5353

Editing Operations

Implicit function can beCombined w/ booleans

Warped

Offset

Composed

And more...

Ohtake, et al., SIGGRAPH 2003

Page 54: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

5454

Editing Operations

Implicit function can beCombined w/ booleans

Warped

Offset

Composed

And more...

Ohtake, et al., SIGGRAPH 2003

Page 55: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

5555

Implicit function can beCombined w/ booleans

Warped

Offset

Composed

And more...

Editing Operations

Ohtake, et al., SIGGRAPH 2003

Page 56: CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,

5656

Point-Based Simulation

MLS originated in mechanics literature

Natural use in graphics for animation

From Mueller, et al., SCA, 2004.