<<

CS148: Introduction to and Imaging Splines and

Topics

Splines  Cubic Hermite  Matrix representation of cubic  Catmull-Rom interpolation Curves  Bezier  Chaiken’s subdivision algorithm  Properties of Bezier curves

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 1 Cubic Hermite Interpolation

Cubic Hermite Interpolation

Given: values and at 2 points CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 2 Cubic Hermite Interpolation

Assume cubic

Solve for coefficients:

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Matrix Representation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 3 Matrix Representation of Polynomials

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Hermite Matrix

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 4 Catmull-Rom Interpolation

Catmull-Rom Interpolation

Interpolate points smoothly Slopes not given though

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 5 Catmull-Rom Interpolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Catmull-Rom Interpolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 6 Catmull-Rom Interpolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Catmull-Rom Interpolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 7 Catmull-Rom Interpolation

Tangent vectors

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Catmull-Rom To Hermite Interpolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 8 Bezier Curves

Paths

Capabilities 1. Smooth curves 2. Line and curve segments 3. Sharp corners

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 9 Cubic Bezier Curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Bezier To Hermite Interpolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 10 Subdivision

Quadratic Bezier Curve (3 Pts)

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 11 Chaiken’s Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Chaiken’s Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 12 Chaiken’s Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Chaiken’s Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 13 Cubic Bezier Curve (4 Pts)

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Bezier Curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 14 Bezier Curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Bezier Curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 15 Bezier Curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Properties

Property 1: Interpolate end points

Property 2: Tangents

Property 3: Convex hull property

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 16 and Subdivision

Bezier Curve - Extrapolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 17 Bezier Curve - Extrapolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Bezier Curve - Extrapolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 18 Bezier Curve - Extrapolation

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Bezier Curve

Original Bezier Curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 19 Bezier Curve

New Bezier Curve Can run the algorithm in reverse to get the original control points. Can prove that the original curve is a piece of the new curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Bezier Curve

Evaluate the algorithm at t=1/2 This subdivides the curve into two pieces

Left Bezier Curve Right Bezier Curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 20 Applications of Subdivision

Drawing Bezier curve ?? Intersect two Bezier curves ??

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Continuity between 2 Bezier Curves

3rd point of the 1st curve is the same as the 1st point of the 2nd curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 21 Continuity between 2 Bezier Curves

Tangent of the 1st curve is equal to the tangent of the 2nd curve

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Demo of Bezier Curves

Page 22 TrueType Quadratic Bezier Splines

Successive control points are marked as either on or off the curve

http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-6.html

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Pyramid Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 23 Pyramid Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Pyramid Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 24 Pyramid Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Pyramid Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 25 Bernstein Polynomials

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Pyramid Algorithm

CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 26 Things to Remember

Splines  Cubic Hermite interpolation  Matrix representation of cubic polynomials  Catmull-Rom (CR) splines  How to think of CR in terms of Hermite Curves  Bezier curve (BC)  How to think of BC in terms of Hermite spline  Chaiken’s algorithm  Subdivision algorithm including applications  Properties of Bezier curves CS148 Lecture 8 Pat Hanrahan, Fall 2009

Page 27