Page 1 CS148: Introduction to Computer Graphics and Imaging Splines and Curves CS148 Lecture 9 Pat Hanrahan, Winter 2009 Topics Splines Cubic Hermite interpolation Matrix representation of cubic polynomials Catmull-Rom interpolation Curves Bezier curve Chaiken’s subdivision algorithm Properties of Bezier curves
30
Embed
CS148: Introduction to Computer Graphics and Imaging ...graphics.stanford.edu/courses/cs148-09/lectures/splines.pdf · CS148: Introduction to Computer Graphics and Imaging Splines
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
CS148: Introduction to Computer Graphics and Imaging
Splines and Curves
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Topics
Splines
Cubic Hermite interpolation
Matrix representation of cubic polynomials
Catmull-Rom interpolation
Curves
Bezier curve
Chaiken’s subdivision algorithm
Properties of Bezier curves
Page 2
Cubic Hermite Interpolation
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Cubic Hermite Interpolation
Given: values and derivatives at 2 points
Page 3
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Assume cubic polynomial
Solve for coefficients:
Cubic Hermite Interpolation
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Matrix Representation
Page 4
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Matrix Representation
Inverse
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Matrix Representation
Page 5
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Matrix Representation of Polynomials
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Matrix Representation of Polynomials
Page 6
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Matrix Representation of Polynomials
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Matrix Representation
Transpose
Page 7
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Matrix Representation of Polynomials
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Hermite Basis Matrix
Page 8
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Hermite Basis Matrix
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Hermite Basis Functions
Page 9
Catmull-Rom Interpolation
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Catmull-Rom Interpolation
Page 10
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Catmull-Rom Interpolation
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Catmull-Rom Interpolation
Page 11
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Catmull-Rom Interpolation
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Catmull-Rom Interpolation
Page 12
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Catmull-Rom Interpolation
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Catmull-Rom To Hermite Interpolation
Page 13
Bezier Curves
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Paths
Capabilities
1. Smooth curves
2. Line and curve segments 3. Kinks
Page 14
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier To Hermite Interpolation
Page 15
Demo of Bezier Curves
Subdivision
Page 16
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Chaiken’s Algorithm
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Chaiken’s Algorithm
Page 17
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Chaiken’s Algorithm
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Chaiken’s Algorithm
Page 18
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Chaiken’s Algorithm
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve
Page 19
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve
Page 20
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve
Page 21
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Properties
Property 1: Interpolate end points
Property 2: Tangents
Property 3: Convex hull property
Extrapolation
Page 22
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve - Extrapolation
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve - Extrapolation
Page 23
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve - Extrapolation
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve - Extrapolation
Page 24
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve
Left Bezier Curve
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Bezier Curve
Right Bezier Curve Left Bezier Curve
Can subdivide a Bezier curve into two pieces
Page 25
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Applications of Subdivision
Drawing Bezier curve
??
Intersect two Bezier curves
??
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Continuity between 2 Bezier Curves
3rd point of the 1st curve is the same as the 1st point of
the 2nd curve
Page 26
CS148 Lecture 9 Pat Hanrahan, Winter 2009
Continuity between 2 Bezier Curves
Tangent of the 1st curve is equal to the tangent of the