1 1 CS 536 Computer Graphics Hermite and Catmull-Rom Curves Week 2, Lecture 4 David Breen, William Regli and Maxim Peysakhov Department of Computer Science Drexel University Additional slides from Don Fussell, University of Texas and Steve Marschner, Cornell University 2 Outline • Hermite Curves • Continuity • Catmull-Rom Curves Hermite Curve 3 • 3D curve of polynomial bases • Geometrically defined by position and tangents at end points • No convex hull guarantees • Supports tangent-continuous (C 1 ) composite curves Algebraic Representation • All of these curves are just parametric algebraic polynomials expressed in different bases • Parametric cubic curve (in R 3 ) • First derivative of curve x = a x u 3 + b x u 2 + c x u + d x y = a y u 3 + b y u 2 + c y u + d y z = a z u 3 + b z u 2 + c z u + d z P(u) = au 3 + bu 2 + cu + d D. Fussell – UT, Austin P '(u) = 3au 2 + 2bu + c x = 3a x u 2 + 2b x u + c x y = 3a y u 2 + 2b y u + c y z = 3a z u 2 + 2b z u + c z Algebraic Representation • All of these curves are just parametric algebraic polynomials expressed in different bases • Parametric cubic curve (in R 3 ) • First derivative of curve P(u) = au 3 + bu 2 + cu + d D. Fussell – UT, Austin P '(u) = 3au 2 + 2bu + c P(0) = d P(1) = a + b + c + d P u (0) = c P u (1) = 3a + 2b + c Hermite Curves • 12 degrees of freedom (4 3-d vector constraints) • Specify endpoints and tangent vectors at endpoints • Solving for the coefficients: P(0) = d P(1) = a + b + c + d P u (0) = c P u (1) = 3a + 2b + c a = 2p(0) − 2p(1) + p u (0) + p u (1) b = −3p(0) + 3p(1) − 2p u (0) − p u (1) c = p u (0) d = p(0) p u (u) ≡ dP du (u) • • p u (0) u = 0 u = 1 p(0) p(1) p u (1) D. Fussell – UT, Austin
5
Embed
Hermiteand Catmull-Rom Curves - Drexel CCIdavid/Classes/CS536/... · 4 21 Parametric Continuity •Continuity(recall from the calculus): –Two curves are Cicontinuous at a point
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
1
1
CS 536Computer Graphics
Hermite and Catmull-Rom CurvesWeek 2, Lecture 4
David Breen, William Regli and Maxim PeysakhovDepartment of Computer Science
Drexel University
Additional slides from Don Fussell, University of Texas andSteve Marschner, Cornell University
Programming Assignment 2• Process command-line arguments• Read in 3D input points and tangents• Compute tangents at interior input points• Modify tangents with tension parameter• Compute Bezier control points for curves defined
by each two input points• Use HW1 code to compute points on each Bezier
curve• Each Bezier curve should be a polyline• Output points by printing them to the console as
an IndexedLineSet with multiple polylines, and control points as spheres in Open Inventor format