CS 445 / 645 Introduction to Computer Graphics Lecture 22 Hermite Splines Lecture 22 Hermite Splines.

Slides:



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

Lecture 14 Curves and Surfaces II
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
#8: Curves and Curved Surfaces CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006.
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 8, 2014 SPLINES CUBIC CURVES HERMITE CURVES BÉZIER CURVES B-SPLINES BICUBIC SURFACES SUBDIVISION SURFACES.
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.
Lecture 10 Curves and Surfaces I
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.
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
Splines II – Interpolating Curves
1Notes  Assignment 0 is due today!  To get better feel for splines, play with formulas in MATLAB!
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
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,
Modeling of curves Needs a ways of representing curves: Reproducible - the representation should give the same curve every time; Computationally Quick;
Computer Graphics 12: Spline Representations
Modelling: Curves Week 11, Wed Mar 23
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.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
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.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves.
V. Space Curves Types of curves Explicit Implicit Parametric.
Curves.
Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Chapter VI Parametric Curves and Surfaces
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
June D Object Representation Shmuel Wimer Bar Ilan Univ., School of Engineering.
CS 445/645 Fall 2001 Splines/Film/Animation. Final Exam Thursday, December 13 th from 7 – 10 p.m. –Room Olsson 011 You may use one sheet of notes (8.5.
CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces.
CS559: Computer Graphics Lecture 19: Curves Li Zhang Spring 2008.
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
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
Spline Interpolation A Primer on the Basics by Don Allen.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
CS 551/651 Advanced Graphics Technical Background.
1 Graphics CSCI 343, Fall 2015 Lecture 34 Curves and Surfaces III.
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 30 of 42 Wednesday, 09.
Dan, Phoenix, Carl.  Several ways you can model  Polynomial functions, linear functions, splines.
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.
Slide 1Lecture Fall ‘00 Surface Modeling Types: Polygon surfaces Curved surfaces Volumes Generating models: Interactive Procedural.
Introduction to Parametric Curve and Surface Modeling.
CSCI480/582 Lecture 9 Chap.2.2 Cubic Splines – Hermit and Bezier Feb, 11, 2009.
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 SPLINES
CS5500 Computer Graphics May 11, 2006
Chapter 10-2: Curves.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves
© University of Wisconsin, CS559 Spring 2004
Chapter XVII Parametric Curves and Surfaces
Spline Interpolation Class XVII.
Parametric Line equations
UNIT-5 Curves and Surfaces.
Introduction to Parametric Curve and Surface Modeling
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.
Presentation transcript:

CS 445 / 645 Introduction to Computer Graphics Lecture 22 Hermite Splines Lecture 22 Hermite Splines

ACM Elections Should take 15 minutes Taking place now in OLS 120 Hurry Back I’m showing movies that you can watch after class today (or some other day) Should take 15 minutes Taking place now in OLS 120 Hurry Back I’m showing movies that you can watch after class today (or some other day)

Splines – Old School

Representations of Curves Problems with series of points used to model a curve Piecewise linear - Does not accurately model a smooth linePiecewise linear - Does not accurately model a smooth line It’s tediousIt’s tedious Expensive to manipulate curve because all points must be repositionedExpensive to manipulate curve because all points must be repositioned Instead, model curve as piecewise-polynomial x = x(t), y = y(t), z = z(t)x = x(t), y = y(t), z = z(t) –where x(), y(), z() are polynomials Problems with series of points used to model a curve Piecewise linear - Does not accurately model a smooth linePiecewise linear - Does not accurately model a smooth line It’s tediousIt’s tedious Expensive to manipulate curve because all points must be repositionedExpensive to manipulate curve because all points must be repositioned Instead, model curve as piecewise-polynomial x = x(t), y = y(t), z = z(t)x = x(t), y = y(t), z = z(t) –where x(), y(), z() are polynomials

Specifying CurvesSpecifying Curves (hyperlink) Control Points A set of points that influence the curve’s shapeA set of points that influence the curve’s shapeKnots Control points that lie on the curveControl points that lie on the curve Interpolating Splines Curves that pass through the control points (knots)Curves that pass through the control points (knots) Approximating Splines Control points merely influence shapeControl points merely influence shape Control Points A set of points that influence the curve’s shapeA set of points that influence the curve’s shapeKnots Control points that lie on the curveControl points that lie on the curve Interpolating Splines Curves that pass through the control points (knots)Curves that pass through the control points (knots) Approximating Splines Control points merely influence shapeControl points merely influence shape

Parametric Curves Very flexible representation They are not required to be functions They can be multivalued with respect to any dimensionThey can be multivalued with respect to any dimension Very flexible representation They are not required to be functions They can be multivalued with respect to any dimensionThey can be multivalued with respect to any dimension

Cubic Polynomials x(t) = a x t 3 + b x t 2 + c x t + d x Similarly for y(t) and z(t)Similarly for y(t) and z(t) Let t: (0 <= t <= 1) Let T = [t 3 t 2 t 1] Coefficient Matrix C Curve: Q(t) = T*C Curve: Q(t) = T*C x(t) = a x t 3 + b x t 2 + c x t + d x Similarly for y(t) and z(t)Similarly for y(t) and z(t) Let t: (0 <= t <= 1) Let T = [t 3 t 2 t 1] Coefficient Matrix C Curve: Q(t) = T*C Curve: Q(t) = T*C

Parametric Curves How do we find the tangent to a curve? If f(x) = x 2 – 4If f(x) = x 2 – 4 –tangent at (x=3) is f’(x) = 2 (x) – 4 = 2 (3) - 4 How do we find the tangent to a curve? If f(x) = x 2 – 4If f(x) = x 2 – 4 –tangent at (x=3) is f’(x) = 2 (x) – 4 = 2 (3) - 4 Derivative of Q(t) is the tangent vector at t: d/dt Q(t) = Q’(t) = d/dt T * C = [3t 2 2t 1 0] * Cd/dt Q(t) = Q’(t) = d/dt T * C = [3t 2 2t 1 0] * C Derivative of Q(t) is the tangent vector at t: d/dt Q(t) = Q’(t) = d/dt T * C = [3t 2 2t 1 0] * Cd/dt Q(t) = Q’(t) = d/dt T * C = [3t 2 2t 1 0] * C

Piecewise Curve Segments One curve constructed by connecting many smaller segments end-to-end Continuity describes the joint 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) One curve constructed by connecting many smaller segments end-to-end Continuity describes the joint 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)

Continuity of Curves If direction (but not necessarily magnitude) of tangent matches G 1 geometric continuityG 1 geometric continuity The tangent value at the end of one curve is proportional to the tangent value of the beginning of the next curveThe tangent value at the end of one curve is proportional to the tangent value of the beginning of the next curve Matching direction and magnitude of d n / dt n –C n continous If direction (but not necessarily magnitude) of tangent matches G 1 geometric continuityG 1 geometric continuity The tangent value at the end of one curve is proportional to the tangent value of the beginning of the next curveThe tangent value at the end of one curve is proportional to the tangent value of the beginning of the next curve Matching direction and magnitude of d n / dt n –C n continous

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?

Parametric Cubic Splines Can represent this as a matrix too

Coefficients So how do we select 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 knots and the continuity conditions[a x b x c x d x ] and [a y b y c y d y ] must satisfy the constraints defined by the knots and the continuity conditions So how do we select 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 knots and the continuity conditions[a x b x c x d x ] and [a y b y c y d y ] must satisfy the constraints defined by the knots and the continuity conditions

Parametric Curves Difficult to conceptualize curve as x(t) = a x t 3 + b x t 2 + c x t + d x (artists don’t think in terms of coefficients of cubics) Instead, define curve as weighted combination of 4 well- defined cubic polynomials (wait a second! Artists don’t think this way either!) Each curve type defines different cubic polynomials and weighting schemes Difficult to conceptualize curve as x(t) = a x t 3 + b x t 2 + c x t + d x (artists don’t think in terms of coefficients of cubics) Instead, define curve as weighted combination of 4 well- defined cubic polynomials (wait a second! Artists don’t think this way either!) Each curve type defines different cubic polynomials and weighting schemes

Parametric Curves Hermite – two endpoints and two endpoint tangent vectors Bezier - two endpoints and two other points that define the endpoint tangent vectors Splines – four control points C1 and C2 continuity at the join pointsC1 and C2 continuity at the join points Come close to their control points, but not guaranteed to touch themCome close to their control points, but not guaranteed to touch them Examples of Splines Examples of Splines Hermite – two endpoints and two endpoint tangent vectors Bezier - two endpoints and two other points that define the endpoint tangent vectors Splines – four control points C1 and C2 continuity at the join pointsC1 and C2 continuity at the join points Come close to their control points, but not guaranteed to touch themCome close to their control points, but not guaranteed to touch them Examples of Splines Examples of Splines

Hermite Cubic Splines An example of knot and continuity constraints

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:

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

Hermite Cubic Spline We know: (x, y) position at t = 0, p 1(x, y) position at t = 0, p 1 We know: (x, y) position at t = 0, p 1(x, y) position at t = 0, p 1

Hermite Cubic Spline We know: (x, y) position at t = 1, p 2(x, y) position at t = 1, p 2 We know: (x, y) position at t = 1, p 2(x, y) position at t = 1, p 2

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

Hermite Cubic Spline We know: (x, y) derivative at t = 0, dp/dt(x, y) derivative at t = 0, dp/dt We know: (x, y) derivative at t = 0, dp/dt(x, y) derivative at t = 0, dp/dt

Hermite Cubic Spline We know: (x, y) derivative at t = 1, dp/dt(x, y) derivative at t = 1, dp/dt We know: (x, y) derivative at t = 1, dp/dt(x, y) derivative at t = 1, dp/dt

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

Solve Hermite Matrix

Spline and Geometry Matrices M Hermite G Hermite

Resulting Hermite Spline Equation

Demonstration Hermite

Sample Hermite Curves

Blending Functions By multiplying first two matrices in lower-left equation, you have four functions of ‘t’ that blend the four control parameters These are blending functions By multiplying first two matrices in lower-left equation, you have four functions of ‘t’ that blend the four control parameters These are blending functions

Hermite Blending Functions If you plot the blending functions on the parameter ‘t’

Hermite Blending Functions Remember, each blending function reflects influence of P 1, P 2,  P 1,  P 2 on spline’s shape