11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.

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
2002 by Jim X. Chen: Bezier Curve Bezier Curve.
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
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.
Lecture 29 of 42 Bezier Curves and Splines Wednesday, 02 April 2008
CS-378: Game Technology Lecture #5: Curves and Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
Curves Chiew-Lan Tai.
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.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 12: Spline Curves (review) Ravi Ramamoorthi Most material.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
Curves Mortenson Chapter 2-5 and Angel Chapter 9
Modelling: Curves Week 11, Wed Mar 23
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
COEN Computer Graphics I
1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided.
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
11/30/04© University of Wisconsin, CS559 Fall 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
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.
1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline.
Cornell CS465 Fall 2004 Lecture 15© 2004 Steve Marschner 1 2D Spline Curves CS 465 Lecture 15.
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.
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.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS Representation of Curves and Surfaces Graphics.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
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.
Parametric Curves CS 318 Interactive Computer Graphics John C. Hart.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
(c) 2002 University of Wisconsin
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 12: Curves 1
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
CS5500 Computer Graphics May 11, 2006
Curve & Surface.
CSE 167 [Win 17], Lecture 9: Curves 1 Ravi Ramamoorthi
Parametric Curves.
© University of Wisconsin, CS559 Fall 2004
© 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.
Procedural Approaches Curves Week 12, Fri 21 Nov 2003
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling –Constructive Solid Geometry –Sweep Objects –Octrees –Blobs and Metaballs and other such things –Production rules

11/19/02 (c) 2002, University of Wisconsin, CS 559 Today Parametric curves –Hermite curves –Bezier curves Homework 5 Due Project 3 Available

11/19/02 (c) 2002, University of Wisconsin, CS 559 Shortcomings So Far The representations we have looked at so far have various failings: –Meshes are large, difficult to edit, require normal approximations, … –Parametric instancing has a limited domain of shapes –CSG is difficult to render and limited in range of shapes –Implicit models are difficult to control and render –Production rules work in highly limited domains Parametric curves and surfaces address many of these issues –More general than parametric instancing –Easier to control than meshes and implicit models

11/19/02 (c) 2002, University of Wisconsin, CS 559 What is it? Define a parameter space –1D for curves –2D for surfaces Define a mapping from parameter space to 3D points –A function that takes parameter values and gives back 3D points The result is a parametric curve or surface 0 t1 Mapping:F:t→(x,y)

11/19/02 (c) 2002, University of Wisconsin, CS 559 Why Parametric Curves? Parametric curves are intended to provide the generality of polygon meshes but with fewer parameters for smooth surfaces –Polygon meshes have as many parameters as there are vertices (at least) Fewer parameters makes it faster to create a curve, and easier to edit an existing curve Normal fields can be properly defined everywhere Parametric curves are easier to animate than polygon meshes

11/19/02 (c) 2002, University of Wisconsin, CS 559 Parametric Curves We have seen the parametric form for a line: Note that x, y and z are each given by an equation that involves: –The parameter t –Some user specified control points, x 0 and x 1 This is an example of a parametric curve

11/19/02 (c) 2002, University of Wisconsin, CS 559 Hermite Spline A spline is a parametric curve defined by control points –The term spline dates from engineering drawing, where a spline was a piece of flexible wood used to draw smooth curves –The control points are adjusted by the user to control the shape of the curve A Hermite spline is a curve for which the user provides: –The endpoints of the curve –The parametric derivatives of the curve at the endpoints (tangents with length) The parametric derivatives are dx/dt, dy/dt, dz/dt –That is enough to define a cubic Hermite spline, more derivatives are required for higher order curves

11/19/02 (c) 2002, University of Wisconsin, CS 559 Hermite Spline (2) Say the user provides A cubic spline has degree 3, and is of the form: –For some constants a, b, c and d derived from the control points, but how? We have constraints: –The curve must pass through x 0 when t=0 –The derivative must be x’ 0 when t=0 –The curve must pass through x 1 when t=1 –The derivative must be x’ 1 when t=1

11/19/02 (c) 2002, University of Wisconsin, CS 559 Hermite Spline (3) Solving for the unknowns gives: Rearranging gives: or

11/19/02 (c) 2002, University of Wisconsin, CS 559 Basis Functions A point on a Hermite curve is obtained by multiplying each control point by some function and summing The functions are called basis functions

11/19/02 (c) 2002, University of Wisconsin, CS 559 Splines in 2D and 3D We have defined only 1D splines: x=f(t:x 0,x 1,x’ 0,x’ 1 ) For higher dimensions, define the control points in higher dimensions (that is, as vectors)

11/19/02 (c) 2002, University of Wisconsin, CS 559 Bezier Curves (1) Different choices of basis functions give different curves –Choice of basis determines how the control points influence the curve –In Hermite case, two control points define endpoints, and two more define parametric derivatives For Bezier curves, two control points define endpoints, and two control the tangents at the endpoints in a geometric way

11/19/02 (c) 2002, University of Wisconsin, CS 559 Bezier Curves (2) The user supplies d control points, p i Write the curve as: The functions B i d are the Bernstein polynomials of degree d –Where else have you seen them? This equation can be written as a matrix equation also –There is a matrix to take Hermite control points to Bezier control points

11/19/02 (c) 2002, University of Wisconsin, CS 559 Bezier Basis Functions for d=3

11/19/02 (c) 2002, University of Wisconsin, CS 559 Some Bezier Curves

11/19/02 (c) 2002, University of Wisconsin, CS 559 Bezier Curve Properties The first and last control points are interpolated The tangent to the curve at the first control point is along the line joining the first and second control points The tangent at the last control point is along the line joining the second last and last control points The curve lies entirely within the convex hull of its control points –The Bernstein polynomials (the basis functions) sum to 1 and are everywhere positive They can be rendered in many ways –E.g.: Convert to line segments with a subdivision algorithm

11/19/02 (c) 2002, University of Wisconsin, CS 559 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: –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. In particular, it is hard to measure the deviation of a line segment from the exact curve

11/19/02 (c) 2002, University of Wisconsin, CS 559 Rendering Bezier Curves (2) Recall that a Bezier curve lies entirely within the convex hull of its control vertices If the control vertices are nearly collinear, then the convex hull is a good approximation to the curve Also, a cubic Bezier curve can be broken into two shorter cubic Bezier curves that exactly cover the original curve This suggests a rendering algorithm: –Keep breaking the curve into sub-curves –Stop when the control points of each sub-curve are nearly collinear –Draw the control polygon - the polygon formed by the control points

11/19/02 (c) 2002, University of Wisconsin, CS 559 Sub-Dividing Bezier Curves Step 1: Find the midpoints of the lines joining the original control vertices. Call them M 01, M 12, M 23 Step 2: Find the midpoints of the lines joining M 01, M 12 and M 12, M 23. Call them M 012, M 123 Step 3: Find the midpoint of the line joining M 012, M 123. Call it M 0123 The curve with control points P 0, M 01, M 012 and M 0123 exactly follows the original curve from the point with t=0 to the point with t=0.5 The curve with control points M 0123, M 123, M 23 and P 3 exactly follows the original curve from the point with t=0.5 to the point with t=1

11/19/02 (c) 2002, University of Wisconsin, CS 559 Sub-Dividing Bezier Curves P0P0 P1P1 P2P2 P3P3 M 01 M 12 M 23 M 012 M 123 M 0123

11/19/02 (c) 2002, University of Wisconsin, CS 559 Sub-Dividing Bezier Curves P0P0 P1P1 P2P2 P3P3

11/19/02 (c) 2002, University of Wisconsin, CS 559 de Casteljau’s Algorithm You can find the point on a Bezier curve for any parameter value t with a similar algorithm Say you want t=0.25, instead of taking midpoints take points 0.25 of the way P0P0 P1P1 P2P2 P3P3 M 01 M 12 M 23 t=0.25

11/19/02 (c) 2002, University of Wisconsin, CS 559 Invariance Translational invariance means that translating the control points and then evaluating the curve is the same as evaluating and then translating the curve Rotational invariance means that rotating the control points and then evaluating the curve is the same as evaluating and then rotating the curve These properties are essential for parametric curves used in graphics It is easy to prove that Bezier curves, Hermite curves and everything else we will study are translation and rotation invariant Some forms of curves, rational splines, are also perspective invariant –Can do perspective transform of control points and then evaluate the curve