March 1, 2009Dr. Muhammed Al-Mulhem1 ICS 415 Computer Graphics Hermite Splines Dr. Muhammed Al-Mulhem March 1, 2009 Dr. Muhammed Al-Mulhem March 1, 2009.

Slides:



Advertisements
Similar presentations
สภาพแวดล้อมการทำงานคอมพิวเตอร์กราฟิกส์ การบรรยายครั้งที่ 7
Advertisements

Parametric Curves Ref: 1, 2.
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
CS 445 / 645 Introduction to Computer Graphics Lecture 22 Hermite Splines Lecture 22 Hermite Splines.
#8: Curves and Curved Surfaces CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006.
Lecture 10 Curves and Surfaces I
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
Jehee Lee Seoul National University
MATH 685/ CSI 700/ OR 682 Lecture Notes
CS 445 / 645 Introduction to Computer Graphics Lecture 22 Hermite Splines Lecture 22 Hermite Splines.
1 Introduction Curve Modelling Jack van Wijk TU Eindhoven.
Dr. S.M. Malaek Assistant: M. Younesi
Slide 127 October 1999CS Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to in Hearn & Baker Splines can be 2D.
1Notes  Assignment 0 is due today!  To get better feel for splines, play with formulas in MATLAB!
Informationsteknologi Monday, December 10, 2007Computer Graphics - Class 161 Today’s class Curve fitting Evaluators Surfaces.
1cs426-winter-2008 Notes  Ian Mitchell is running a MATLAB tutorial, Tuesday January 15, 5pm-7pm, DMP 110 We won’t be directly using MATLAB in this course,
1 Dr. Scott Schaefer Curves and Interpolation. 2/61 Smooth Curves How do we create smooth curves?
09/18/02 Dinesh Manocha, COMP258 Parametric Patches Tensor product or rectangular patches are of the form: P(u,w) = u,w [0,1]. The number of control points.
Drawing Parametric Curves Jean-Paul Mueller. Curves - The parametric form of a curve expresses the value of each spatial variable for points on the curve.
1 Dr. Scott Schaefer Catmull-Rom Splines: Combining B-splines and Interpolation.
Computer Graphics 12: Spline Representations
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 24 Regression Analysis-Chapter 17.
RASTER CONVERSION ALGORITHMS FOR CURVES: 2D SPLINES 2D Splines - Bézier curves - Spline curves.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 21 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
Curve Surfaces June 4, Examples of Curve Surfaces Spheres The body of a car Almost everything in nature.
Bresenham’s Algorithm. Line Drawing Reference: Edward Angel’s book: –6 th Ed. Sections 6.8 and 6.9 Assuming: –Clipped (to fall within the window) –2D.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
V. Space Curves Types of curves Explicit Implicit Parametric.
Spline Representations
Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
Chapter 4 Representations of Curves and Surfaces.
Chapter VI Parametric Curves and Surfaces
June D Object Representation Shmuel Wimer Bar Ilan Univ., School of Engineering.
2011 COURSE IN NEUROINFORMATICS MARINE BIOLOGICAL LABORATORY WOODS HOLE, MA Introduction to Spline Models or Advanced Connect-the-Dots Uri Eden BU Department.
Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W Th , F
Ship Computer Aided Design MR 422. Geometry of Curves 1.Introduction 2.Mathematical Curve Definitions 3.Analytic Properties of Curves 4.Fairness of Curves.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
L5 – Curves in GIS NGEN06 & TEK230: Algorithms in Geographical Information Systems by: Sadegh Jamali (source: Lecture notes in GIS, Lars Harrie) 1 L5-
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
Ship Computer Aided Design
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 30 of 42 Wednesday, 09.
1 Lecture 8 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Dan, Phoenix, Carl.  Several ways you can model  Polynomial functions, linear functions, splines.
Math 495B Polynomial Interpolation Special case of a step function. Frederic Gibou.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
CS552: Computer Graphics Lecture 18: Representing Cubic Splines.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Introduction to Parametric Curve and Surface Modeling.
Lecture 29: Modeling Data. Data Modeling Interpolate between data points, using either linear or cubic spline models Model a set of data points as a polynomial.
CSCI480/582 Lecture 9 Chap.2.2 Cubic Splines – Hermit and Bezier Feb, 11, 2009.
Constructing Objects in Computer Graphics
CS5500 Computer Graphics May 11, 2006
Curves and Surfaces.
Chapter 10-2: Curves.
Chapter XVII Parametric Curves and Surfaces
Spline Interpolation Class XVII.
Parametric Line equations
CSCI 440 Computer Graphics
Type to enter a caption. Computer Graphics Week 10 Lecture 1.
Spline representation. ❖ A spline is a flexible strip used to produce a smooth curve through a designated set of points. ❖ Mathematically describe such.
Type to enter a caption. Computer Graphics Week 10 Lecture 2.
Overview June 9- B-Spline Curves June 16- NURBS Curves
Presentation transcript:

March 1, 2009Dr. Muhammed Al-Mulhem1 ICS 415 Computer Graphics Hermite Splines Dr. Muhammed Al-Mulhem March 1, 2009 Dr. Muhammed Al-Mulhem March 1, 2009

Dr. Muhammed Al-Mulhem2 Spline A spline is a a flexible strip used to produce a smooth curve through a set of points.A spline is a a flexible strip used to produce a smooth curve through a set of points.

March 1, 2009Dr. Muhammed Al-Mulhem3 Representations of Curves A curve can be represented using: – –A sequence of points. – –A piecewise polynomial functions. A spline curve refers to any composite curve formed with polynomial sections. A curve can be represented using: – –A sequence of points. – –A piecewise polynomial functions. A spline curve refers to any composite curve formed with polynomial sections.

March 1, 2009Dr. Muhammed Al-Mulhem4 Specifying Curves A spline curve is specified as follows: – –Giving a set of coordinate positions, called control Points, which indicate the general shape of the curve. – –These points are then fitted with piecewise polynomial functions in one of two ways:   Interpolation   Approximation A spline curve is specified as follows: – –Giving a set of coordinate positions, called control Points, which indicate the general shape of the curve. – –These points are then fitted with piecewise polynomial functions in one of two ways:   Interpolation   Approximation

March 1, 2009Dr. Muhammed Al-Mulhem5 Specifying Curves Interpolation: – –When polynomial sections are fitted so that all the control points are on the curve, the resulting curve is said to interpolate the set of control points. Interpolation: – –When polynomial sections are fitted so that all the control points are on the curve, the resulting curve is said to interpolate the set of control points.

March 1, 2009Dr. Muhammed Al-Mulhem6 Specifying Curves Approximation – –When polynomial sections are fitted so that some or all the control points are not on the curve, the resulting curve is said to approximate the set of control points. Approximation – –When polynomial sections are fitted so that some or all the control points are not on the curve, the resulting curve is said to approximate the set of control points.

March 1, 2009Dr. Muhammed Al-Mulhem7 Parametric Continuity To ensure a smooth transition from one section of a piecewise parametric spline to the next, we impose various continuity conditions at the connection points. If each section of a spline curve is described with a set of parametric coordinate function of the form x = x(u), y= y(u), z = z(u), u 1 <= u <= u 2 We set parametric continuity by matching the parametric derivatives of adjoining curve sections at their common boundary. To ensure a smooth transition from one section of a piecewise parametric spline to the next, we impose various continuity conditions at the connection points. If each section of a spline curve is described with a set of parametric coordinate function of the form x = x(u), y= y(u), z = z(u), u 1 <= u <= u 2 We set parametric continuity by matching the parametric derivatives of adjoining curve sections at their common boundary.

March 1, 2009Dr. Muhammed Al-Mulhem8 Parametric Continuity Various continuity conditions: C 0 continuity (Zero-order parametric continuity): – –Means simply that curves meet. That is, the values of x, y, and z evaluated at u 2 for the first curve section are equal, respectively, to the values of x, y, and z evaluated at u 1 of the next curve section. Various continuity conditions: C 0 continuity (Zero-order parametric continuity): – –Means simply that curves meet. That is, the values of x, y, and z evaluated at u 2 for the first curve section are equal, respectively, to the values of x, y, and z evaluated at u 1 of the next curve section.

March 1, 2009Dr. Muhammed Al-Mulhem9 Parametric Continuity C 1 continuity (First-order parametric continuity): – –Means that is the first parametric derivatives (tangent line) of the coordinate functions (above equations in slide 7) for two successive curve sections are equal at their joining point. C 1 continuity (First-order parametric continuity): – –Means that is the first parametric derivatives (tangent line) of the coordinate functions (above equations in slide 7) for two successive curve sections are equal at their joining point.

March 1, 2009Dr. Muhammed Al-Mulhem10 Parametric Continuity C 2 continuity (Second-order parametric continuity): – –Means that both the first and second parametric derivatives of the two curve sections are the same at the intersection. Higher order parametric continuity conditions are defined similarly. C 2 continuity (Second-order parametric continuity): – –Means that both the first and second parametric derivatives of the two curve sections are the same at the intersection. Higher order parametric continuity conditions are defined similarly.

March 1, 2009Dr. Muhammed Al-Mulhem11 Parametric Continuity

March 1, 2009Dr. Muhammed Al-Mulhem12 Parametric Continuity

March 1, 2009Dr. Muhammed Al-Mulhem13 Cubic Spline Cubic spline requires less calculations and storage space, and more stable than higher-order polynomials. Given a set of control points, cubic interpolation splines are obtained by fitting the input points with a piecewise cubic polynomial curve that passes through every control point. Cubic spline requires less calculations and storage space, and more stable than higher-order polynomials. Given a set of control points, cubic interpolation splines are obtained by fitting the input points with a piecewise cubic polynomial curve that passes through every control point.

March 1, 2009Dr. Muhammed Al-Mulhem14 Cubic Polynomials A parametric cubic polynomial that is to be fitted between each pair of control points with the following equations: x(t) = a x t 3 + b x t 2 + c x t + d x y(t) = a x t 3 + b x t 2 + c x t + d x z(t) = a x t 3 + b x t 2 + c x t + d x 0 <= t <= 1 A parametric cubic polynomial that is to be fitted between each pair of control points with the following equations: x(t) = a x t 3 + b x t 2 + c x t + d x y(t) = a x t 3 + b x t 2 + c x t + d x z(t) = a x t 3 + b x t 2 + c x t + d x 0 <= t <= 1

March 1, 2009Dr. Muhammed Al-Mulhem15 Cubic Polynomials Let T = [t 3 t 2 t 1] Coefficient Matrix C The the cuve Q(t) can be represented as: Q(t) = T*C Let T = [t 3 t 2 t 1] Coefficient Matrix C The the cuve Q(t) can be represented as: Q(t) = T*C

March 1, 2009Dr. Muhammed Al-Mulhem16 Parametric Curves How do we find the tangent to a curve? If f(x) = x 2 -4 – –tangent at (x=3) is   f’(x) = 2x - 4 = 2(3) - 4 = 2 How do we find the tangent to a curve? If f(x) = x 2 -4 – –tangent at (x=3) is   f’(x) = 2x - 4 = 2(3) - 4 = 2 Derivative of Q(t) is the tangent vector at t:

March 1, 2009Dr. Muhammed Al-Mulhem17 Piecewise Curve Segments One curve constructed by connecting many smaller segments end-to-end Must have rules for how the segments are joined Continuity describes the joint Parametric continuity Geometric continuity One curve constructed by connecting many smaller segments end-to-end Must have rules for how the segments are joined Continuity describes the joint Parametric continuity Geometric continuity

March 1, 2009Dr. Muhammed Al-Mulhem18 Parametric Continuity C 1 is tangent continuity (velocity)C 1 is tangent continuity (velocity) C 2 is 2 nd derivative continuity (acceleration)C 2 is 2 nd derivative continuity (acceleration) Matching direction and magnitude of d n / dt nMatching direction and magnitude of d n / dt n  C n continous C 1 is tangent continuity (velocity)C 1 is tangent continuity (velocity) C 2 is 2 nd derivative continuity (acceleration)C 2 is 2 nd derivative continuity (acceleration) Matching direction and magnitude of d n / dt nMatching direction and magnitude of d n / dt n  C n continous

March 1, 2009Dr. Muhammed Al-Mulhem19 Geometric Continuity Requires the parametric dervatives of the two sections are prportional to each other at their common boundary, instead of requiring equality. If positions match G 0 geometric continuity If direction (but not necessarily magnitude) of tangent matches G 1 geometric continuity The tangent value at the end of one curve is proportional to the tangent value of the beginning of the next curve Requires the parametric dervatives of the two sections are prportional to each other at their common boundary, instead of requiring equality. If positions match G 0 geometric continuity If direction (but not necessarily magnitude) of tangent matches G 1 geometric continuity The tangent value at the end of one curve is proportional to the tangent value of the beginning of the next curve

March 1, 2009Dr. Muhammed Al-Mulhem20 Parametric Cubic Curves In order to assure C 2 continuity, curves must be of at least degree 3 Here is the parametric definition of a cubic (degree 3) spline in two dimensions How do we extend it to three dimensions? In order to assure C 2 continuity, curves must be of at least degree 3 Here is the parametric definition of a cubic (degree 3) spline in two dimensions How do we extend it to three dimensions?

March 1, 2009Dr. Muhammed Al-Mulhem21 Parametric Cubic Splines Can represent this as a matrix.

March 1, 2009Dr. Muhammed Al-Mulhem22 Coefficients So how do we select the coefficients? The coefficients [a x b x c x d x ] and [a y b y c y d y ] must satisfy the constraints defined by the continuity conditions So how do we select the coefficients? The coefficients [a x b x c x d x ] and [a y b y c y d y ] must satisfy the constraints defined by the continuity conditions

March 1, 2009Dr. Muhammed Al-Mulhem23 Parametric Curves There are many splines developed, some of these are: – –Hermite – –Bezier There are many splines developed, some of these are: – –Hermite – –Bezier

March 1, 2009Dr. Muhammed Al-Mulhem24 Hermite Splines A Hermite spline is an interpolating cubic polynomial with a specified tangent at each control point. It can be adjusted locally because each curve section is only dependent on its endpoint constraints. A Hermite spline is an interpolating cubic polynomial with a specified tangent at each control point. It can be adjusted locally because each curve section is only dependent on its endpoint constraints.

March 1, 2009Dr. Muhammed Al-Mulhem25 Hermite Cubic Splines One cubic curve for each dimension. A curve constrained to x/y-plane has two curves. One cubic curve for each dimension. A curve constrained to x/y-plane has two curves.

March 1, 2009Dr. Muhammed Al-Mulhem26 Hermite Cubic Splines A 2-D Hermite Cubic Spline is defined by eight parameters: a, b, c, d, e, f, g, h How do we convert the intuitive endpoint constraints into these (relatively) unintuitive eight parameters? We know: (x, y) position at t = 0, p 1(x, y) position at t = 0, p 1 (x, y) position at t = 1, p 2(x, y) position at t = 1, p 2 (x, y) derivative at t = 0, dp/dt(x, y) derivative at t = 0, dp/dt (x, y) derivative at t = 1, dp/dt(x, y) derivative at t = 1, dp/dt A 2-D Hermite Cubic Spline is defined by eight parameters: a, b, c, d, e, f, g, h How do we convert the intuitive endpoint constraints into these (relatively) unintuitive eight parameters? We know: (x, y) position at t = 0, p 1(x, y) position at t = 0, p 1 (x, y) position at t = 1, p 2(x, y) position at t = 1, p 2 (x, y) derivative at t = 0, dp/dt(x, y) derivative at t = 0, dp/dt (x, y) derivative at t = 1, dp/dt(x, y) derivative at t = 1, dp/dt

March 1, 2009Dr. Muhammed Al-Mulhem27 Hermite Cubic Spline We know: (x, y) position at t = 0, p 1 We know: (x, y) position at t = 0, p 1

March 1, 2009Dr. Muhammed Al-Mulhem28 Hermite Cubic Spline We know: (x, y) position at t = 1, p 2 We know: (x, y) position at t = 1, p 2

March 1, 2009Dr. Muhammed Al-Mulhem29 Hermite Cubic Splines So far we have four equations, but we have eight unknowns Use the derivatives So far we have four equations, but we have eight unknowns Use the derivatives

March 1, 2009Dr. Muhammed Al-Mulhem30 Hermite Cubic Spline We know: (x, y) derivative at t = 0, dp/dt We know: (x, y) derivative at t = 0, dp/dt

March 1, 2009Dr. Muhammed Al-Mulhem31 Hermite Cubic Spline We know: (x, y) derivative at t = 1, dp/dt We know: (x, y) derivative at t = 1, dp/dt

March 1, 2009Dr. Muhammed Al-Mulhem32 Hermite Specification Matrix equation for Hermite Curve t = 0 t = 1 t = 0 t = 1 t 3 t 2 t 1 t 0 p1p1 p2p2 r p 1 r p 2

March 1, 2009Dr. Muhammed Al-Mulhem33 Solve Hermite Matrix

March 1, 2009Dr. Muhammed Al-Mulhem34 Spline and Geometry Matrices M Hermite G Hermite

March 1, 2009Dr. Muhammed Al-Mulhem35 Resulting Hermite Spline Equation

March 1, 2009Dr. Muhammed Al-Mulhem36 Sample Hermite Curves

March 1, 2009Dr. Muhammed Al-Mulhem37 Hermite Curves If P(u) represents a parametric cubic point functionfor the cuve section between control points P k and P k+1 as shown bellow: PkPk P k+1 P(u) = (x(u), y(u), z(u)), where x(u)=a x u 3 + b x u 2 + c x u + d x y(u)=a y u 3 + b y u 2 + c y u + d y z(u)=a z u 3 + b z u 2 + c z u + d z

March 1, 2009Dr. Muhammed Al-Mulhem38 Hermite Curves The boundary conditions that define this Hermite curve section are:   P(0) = P k   P(1) = P k+1   P’(0) = D Pk   P’(1) = D Pk+1 With D Pk and D Pk+1 specifying the values for the parametric derivatives at control points P k and P k+1 The boundary conditions that define this Hermite curve section are:   P(0) = P k   P(1) = P k+1   P’(0) = D Pk   P’(1) = D Pk+1 With D Pk and D Pk+1 specifying the values for the parametric derivatives at control points P k and P k+1

March 1, 2009Dr. Muhammed Al-Mulhem39 Hermite Curves We can write the vector equivalent for the Hermit curve section as: – –P(u) = a u 3 + b u 2 + cu + d 0<= u <= 1 Where the x, y and z components of P(u) is x(u)=a x u 3 + b x u 2 + c x u + d x y(u)=a y u 3 + b y u 2 + c y u + d y z(u)=a z u 3 + b z u 2 + c z u + d z We can write the vector equivalent for the Hermit curve section as: – –P(u) = a u 3 + b u 2 + cu + d 0<= u <= 1 Where the x, y and z components of P(u) is x(u)=a x u 3 + b x u 2 + c x u + d x y(u)=a y u 3 + b y u 2 + c y u + d y z(u)=a z u 3 + b z u 2 + c z u + d z

March 1, 2009Dr. Muhammed Al-Mulhem40 Hermite Curves The matrix equivalent is And the derivative of the point function is The matrix equivalent is And the derivative of the point function is

March 1, 2009Dr. Muhammed Al-Mulhem41 Hermite Curves Substituting endpoint values 0 and 1 for parameter u into the above two equations, we can express the Hermite boundary conditions in the matrix form

March 1, 2009Dr. Muhammed Al-Mulhem42 Hermite Curves Solving this equation for the polynomial coefficients, we have M H, the Hermite matrix, is the inverse of the boundary condition matrix. Solving this equation for the polynomial coefficients, we have M H, the Hermite matrix, is the inverse of the boundary condition matrix.

March 1, 2009Dr. Muhammed Al-Mulhem43 Hermite Curves The above matrix can be written in terms of the boundary conditions as This can be used to determine the expressions for the polynomial Herimte functions. The above matrix can be written in terms of the boundary conditions as This can be used to determine the expressions for the polynomial Herimte functions.

March 1, 2009Dr. Muhammed Al-Mulhem44 Hermite Blending Functions The above matrix can be used to determine the expressions for the polynomial Herimte functions, – –H k (u) for k=0,1,2,3 This can be done by carrying out the matrix multiplications and collecting coefficient for the boundary conditions to obtain the polynomial form: P(u) = P k (2u 3 - 3u 2 + 1) + P k+1 (-2u 3 + 3u 2 ) + D Pk (u 3 -2u 2 + u) + D Pk+1 (u 3 u 2 ) = P k H 0 (u) + P k+1 H 1 (u) + D Pk H 2 (u) + D Pk+1 H 3 (u) The above matrix can be used to determine the expressions for the polynomial Herimte functions, – –H k (u) for k=0,1,2,3 This can be done by carrying out the matrix multiplications and collecting coefficient for the boundary conditions to obtain the polynomial form: P(u) = P k (2u 3 - 3u 2 + 1) + P k+1 (-2u 3 + 3u 2 ) + D Pk (u 3 -2u 2 + u) + D Pk+1 (u 3 u 2 ) = P k H 0 (u) + P k+1 H 1 (u) + D Pk H 2 (u) + D Pk+1 H 3 (u)

March 1, 2009Dr. Muhammed Al-Mulhem45 Blending Functions