Modelling: Curves Week 11, Wed Mar 23

Slides:



Advertisements
Similar presentations
Curves Jim Van Verth Essential Math for Games Animation Problem: want to replay stored set of transformations  Generated by.
Advertisements

Lecture Notes #11 Curves and Surfaces II
Computer Graphics (Spring 2008) COMS 4160, Lecture 6: Curves 1
© University of Wisconsin, CS559 Spring 2004
Lecture 10 Curves and Surfaces I
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
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.
© University of Wisconsin, CS559 Spring 2004
B-Spline Blending Functions
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
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Slide 127 October 1999CS Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to in Hearn & Baker Splines can be 2D.
Splines II – Interpolating Curves
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.
Curves Chiew-Lan Tai. Curves 2 Reading Required Hearn & Baker, 8-8 – 8-10, 8-12 Foley, 11.2.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Curves Week 12, Wed Apr.
Cubic Bezier and B-Spline Curves
Curves Mortenson Chapter 2-5 and Angel Chapter 9
Bezier and Spline Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
COEN Computer Graphics I
Curve Surfaces June 4, Examples of Curve Surfaces Spheres The body of a car Almost everything in nature.
Splines III – Bézier Curves
Computer Graphics Lecture 13 Curves and Surfaces I.
Curve Modeling Bézier Curves
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.
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.
Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves.
V. Space Curves Types of curves Explicit Implicit Parametric.
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline.
Curves.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Parametric Curves.
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.
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
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.
Representation of Curves & Surfaces Prof. Lizhuang Ma Shanghai Jiao Tong University.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
11/26/02(C) University of Wisconsin Last Time BSplines.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
(c) 2002 University of Wisconsin
Slide 129 October 1999CS Computer Graphics (Top Changwatchai) Bézier Curves - Results of Derivation Tangents at endpoints are equal to endpoint slopes.
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
1 Graphics CSCI 343, Fall 2015 Lecture 34 Curves and Surfaces III.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Introduction to Parametric Curve and Surface Modeling.
© University of Wisconsin, CS559 Spring 2004
Introduction to Parametric Curve and Surface Modeling
Curve & Surface.
CS 445 / 645 Introduction to Computer Graphics
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
Implicit Functions Some surfaces can be represented as the vanishing points of functions (defined over 3D space) Places where a function f(x,y,z)=0 Some.
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

Modelling: Curves Week 11, Wed Mar 23 http://www.ugrad.cs.ubc.ca/~cs314/Vjan2005

News reminder: my office hours today 3:45 proposals due today 6pm

News midterms:min 33, max 98, median 68

Reading FCG Chap 13

Parametric Curves parametric form for a line: x, y and z are each given by an equation that involves: parameter t some user specified control points, x0 and x1 this is an example of a parametric curve

Splines a spline is a parametric curve defined by control points term “spline” dates from engineering drawing, where a spline was a piece of flexible wood used to draw smooth curves control points are adjusted by the user to control shape of curve

Splines - History draftsman used ‘ducks’ and strips of wood (splines) to draw curves wood splines have second-order continuity, pass through the control points a duck (weight) ducks trace out curve

Hermite Spline hermite spline is curve for which user provides: endpoints of curve parametric derivatives of curve at endpoints parametric derivatives are dx/dt, dy/dt, dz/dt more derivatives would be required for higher order curves

Hermite Cubic Splines example of knot and continuity constraints

Hermite Spline (2) say user provides cubic spline has degree 3, is of the form: for some constants a, b, c and d derived from the control points, but how? we have constraints: curve must pass through x0 when t=0 derivative must be x’0 when t=0 curve must pass through x1 when t=1 derivative must be x’1 when t=1

Hermite Spline (3) solving for the unknowns gives rearranging gives or

Basis Functions a point on a Hermite curve is obtained by multiplying each control point by some function and summing functions are called basis functions

Sample Hermite Curves

Splines in 2D and 3D so far, defined only 1D splines: x=f(t:x0,x1,x’0,x’1) for higher dimensions, define control points in higher dimensions (that is, as vectors)

Bézier Curves similar to Hermite, but more intuitive definition of endpoint derivatives four control points, two of which are knots

Bézier Curves derivative values of Bezier curve at knots dependent on adjacent points

Bézier vs. Hermite can write Bezier in terms of Hermite note: just matrix form of previous equations

Bézier vs. Hermite Now substitute this in for previous Hermite

Bézier Basis, Geometry Matrices but why is MBezier a good basis matrix?

Bézier Blending Functions look at blending functions family of polynomials called order-3 Bernstein polynomials C(3, k) tk (1-t)3-k; 0<= k <= 3 all positive in interval [0,1] sum is equal to 1

Bézier Blending Functions every point on curve is linear combination of control points weights of combination are all positive sum of weights is 1 therefore, curve is a convex combination of the control points

Bézier Curves curve will always remain within convex hull (bounding region) defined by control points

Bézier Curves interpolate between first, last control points 1st point’s tangent along line joining 1st, 2nd pts 4th point’s tangent along line joining 3rd, 4th pts

Comparing Hermite and Bézier

Comparing Hermite and Bezier demo: www.siggraph.org/education/materials/HyperGraph/modeling/splines/demoprog/curve.html

Rendering Bezier Curves: Simple evaluate curve at fixed set of parameter values, join points with straight lines advantage: very simple disadvantages: expensive to evaluate the curve at many points no easy way of knowing how fine to sample points, and maybe sampling rate must be different along curve no easy way to adapt: hard to measure deviation of line segment from exact curve

Rendering Beziers: Subdivision a cubic Bezier curve can be broken into two shorter cubic Bezier curves that exactly cover original curve suggests a rendering algorithm: keep breaking curve into sub-curves stop when control points of each sub-curve are nearly collinear draw the control polygon: polygon formed by control points

Sub-Dividing Bezier Curves step 1: find the midpoints of the lines joining the original control vertices. call them M01, M12, M23 M12 P1 P2 M01 M23 P0 P3

Sub-Dividing Bezier Curves step 2: find the midpoints of the lines joining M01, M12 and M12, M23. call them M012, M123 P0 P1 P2 P3 M01 M12 M23 M012 M123

Sub-Dividing Bezier Curves step 3: find the midpoint of the line joining M012, M123. call it M0123 P0 P1 P2 P3 M01 M12 M23 M012 M123 M0123

Sub-Dividing Bezier Curves curve P0, M01, M012, M0123 exactly follows original from t=0 to t=0.5 curve M0123 , M123 , M23, P3 exactly follows original from t=0.5 to t=1 P0 P1 P2 P3 M01 M12 M23 M012 M123 M0123

Sub-Dividing Bezier Curves continue process to create smooth curve P1 P2 P0 P3

de Casteljau’s Algorithm can find the point on a Bezier curve for any parameter value t with similar algorithm for t=0.25, instead of taking midpoints take points 0.25 of the way M12 P2 P1 M23 t=0.25 M01 P0 P3 demo: www.saltire.com/applets/advanced_geometry/spline/spline.htm

Longer Curves a single cubic Bezier or Hermite curve can only capture a small class of curves at most 2 inflection points one solution is to raise the degree allows more control, at the expense of more control points and higher degree polynomials control is not local, one control point influences entire curve better solution is to join pieces of cubic curve together into piecewise cubic curves total curve can be broken into pieces, each of which is cubic local control: each control point only influences a limited part of the curve interaction and design is much easier

Piecewise Bezier: Continuity Problems demo: www.cs.princeton.edu/~min/cs426/jar/bezier.html

Continuity when two curves joined, typically want some degree of continuity across knot boundary C0, “C-zero”, point-wise continuous, curves share same point where they join C1, “C-one”, continuous derivatives C2, “C-two”, continuous second derivatives

Geometric Continuity derivative continuity is important for animation if object moves along curve with constant parametric speed, should be no sudden jump at knots for other applications, tangent continuity suffices requires that the tangents point in the same direction referred to as G1 geometric continuity curves could be made C1 with a re-parameterization geometric version of C2 is G2, based on curves having the same radius of curvature across the knot

Achieving Continuity Hermite curves Bezier curves user specifies derivatives, so C1 by sharing points and derivatives across knot Bezier curves they interpolate endpoints, so C0 by sharing control pts introduce additional constraints to get C1 parametric derivative is a constant multiple of vector joining first/last 2 control points so C1 achieved by setting P0,3=P1,0=J, and making P0,2 and J and P1,1 collinear, with J-P0,2=P1,1-J C2 comes from further constraints on P0,1 and P1,2 leads to...

B-Spline Curve start with a sequence of control points select four from middle of sequence (pi-2, pi-1, pi, pi+1) Bezier and Hermite goes between pi-2 and pi+1 B-Spline doesn’t interpolate (touch) any of them but approximates the going through pi-1 and pi P2 P6 P1 P3 P0 P4 P5

B-Spline by far the most popular spline used C0, C1, and C2 continuous demo: www.siggraph.org/education/materials/HyperGraph/modeling/splines/demoprog/curve.html

B-Spline locality of points