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.

Slides:



Advertisements
Similar presentations
Interpolating curves.
Advertisements

Lecture Notes #11 Curves and Surfaces II
Computer Graphics (Spring 2008) COMS 4160, Lecture 6: Curves 1
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.
Jehee Lee Seoul National University
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.
Lecture 29 of 42 Bezier Curves and Splines Wednesday, 02 April 2008
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 12: Spline Curves (review) Ravi Ramamoorthi Most material.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Subdivision Primer CS426, 2000 Robert Osada [DeRose 2000]
Modelling: Curves Week 11, Wed Mar 23
Computer Graphics (Fall 2005) COMS 4160, Lecture 7: Curves 2
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Chapter 10: Curves and Surfaces Part 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
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
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.
19/13/ :20 UML Graphics II Parametric Curves and Surfaces Session 3.
C O M P U T E R G R A P H I C S Stuff Jian Chen January 15, 2010 Transformations 1/10 Describing Shape By Andries van Dam.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
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.
Curves.
1 Dr. Scott Schaefer Coons Patches and Gregory Patches.
Cornell CS465 Fall 2004 Lecture 15© 2004 Steve Marschner 1 2D Spline Curves CS 465 Lecture 15.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
Curves. First of all… You may ask yourselves “What did those papers have to do with computer graphics?” –Valid question Answer: I thought they were cool,
June D Object Representation Shmuel Wimer Bar Ilan Univ., School of Engineering.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Parametric Curves.
Graphics Graphics Korea University cgvr.korea.ac.kr Parametric Curves 고려대학교 컴퓨터 그래픽스 연구실.
Curves and Surfaces Chapter 10. CS 480/680 2Chapter 9 -- Hierarchical Models Introduction: Introduction: Until now we have worked with flat entities such.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS Representation of Curves and Surfaces Graphics.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
Review CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2005.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
Splines I – Curves and Properties based on: Michael Gleicher Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
Computer Graphics (Fall 2003) COMS 4160, Lecture 10: Curves 1 Ravi Ramamoorthi
Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 32 of 42 Wednesday, 11.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
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:
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Piecewise Polynomial Parametric Curves Sun-Jeong Kim.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Introduction to Parametric Curve and Surface Modeling.
Constructing Objects in Computer Graphics
CS5500 Computer Graphics May 11, 2006
Curve & Surface.
Parametric Curves cgvr.korea.ac.kr.
CSE 167 [Win 17], Lecture 10: Curves 2 Ravi Ramamoorthi
Chapter 10-2: Curves.
CSE 167 [Win 17], Lecture 9: Curves 1 Ravi Ramamoorthi
© 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.
Coons Patches and Gregory Patches
CSCE 441: Keyframe Animation/Smooth Curves (Cont.)
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

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

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 2/23 To do Continue to work on ray programming assignment Start thinking about final project

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 3/23 Curved Surfaces Motivation –Exact boundary representation for some objects –More concise representation that polygonal mesh –Easier to model with and specify for many man-made objects and machine parts (started with car bodies)

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 4/23 Curve and surface Representations Curve representation –Function: y = f(x) –Implicit: f(x, y) = 0 –Subdivision: (x, y) as limit of recursive process –Parametric: x = f(t), y = g(t) Curved surface representation –Function: z = f(x, y) –Implicit: f(x, y, z)=0 –Subdivision: (x, y, z) as limit of recursive process –Parametric: x = f(s, t), y=g(s, t), z = h(s, t)

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 5/23 Parametric Surfaces Boundary defined by parametic function –x = f(u, v) –y = f(u, v) –Z = f(u, v) Example (sphere): –X = sin () cos () –Y = sin () sin () –Z = cos()

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 6/23 Parametric Representation One function vs. many (defined piecewise) Continuity A parametric polynomial curve of order n: Advantages of polynomial curves –Easy to compute –Infinitely differentiable everywhere

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 7/23 Spline Constructions Cubic spline is the most common form Common constructions –Bezier: 4 control points –B-splines: approximating C 2, local control –Hermite: 2 points, 2 normals –Natural splines: interpolating, C 2, no local control –Catmull-Rom: interpolating, C 1, local control

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 8/23 Bezier Curve Motivation: Draw a smooth intuitive curve (or surface) given a few key user-specified control points Properties: –Interpolates is tangent to end points –Curve within convex hull of control polygon Smooth Bezier curve (drawn automatically) Control polygon Control point

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 9/23 Linear Bezier Curve Just a simple linear combination or interpolation (easy to code up, very numerically stable) P0 P1 F(0) F(u) F(1) Linear (Degree 1, Order 2) F(0) = P0, F(1) = P1 F(u) = ? P0P1 1-uu F(u) = (1-u) P0 + u P1

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 10/23 deCastljau: Quadratic Bezier Curve P0 P1 P2 Quadratic Degree 2, Order 3 F(0) = P0, F(1) = P2 F(u) = ? F(u) = (1-u) 2 P0 + 2u(1-u) P1 + u 2 P2 P0P1P2 1-u u u u

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 11/23 Geometric Interpretation: Quadratic u u u 1-u

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 12/23 Geometric Interpolation: Cubic u u u u u u

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 13/23 Summary: deCasteljau Algorithm A recursive implementation of curves at different orders Linear Degree 1, Order 2 F(0) = P0, F(1) = P1 P0 P1 P0P1 1-uu F(u) = (1-u) P0 + u P1 P0 P1 P2 Quadratic Degree 2, Order 3 F(0) = P0, F(1) = P2 P0P1P2 F(u) = (1-u) 2 P0 + 2u(1-u) P1 + u 2 P2 1-u u u u

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 14/23 Summary: deCasteljau Algorithm A recursive implementation of curves at different orders Further consideration: polar coordinates P0 P1P2 P3 Cubic Degree 3, Order 4 F(0) = P0, F(1) = P3 P0P1P2P3 1-u u u uu u u F(u) = (1-u) 3 P0 +3u(1-u) 2 P1 +3u 2 (1-u) P2 + u 3 P3 1-u

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 15/23 Bezier: disadvantages Single piece, no local control (move a control point, whole curve changes) Complex shapes: can be very high degree, difficult to deal with In practice: combine many Bezier curve segments –But only position continuous at the joint points since Bezier curves interpolate end-points (which match at segment boundaries) –Unpleasant derivative (slope) discontinuities at end-points

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 16/23 Piecewise polynomial curves Ideas: –Use different polynomial functions for different parts of the curve Advantage: –Flexibility –Local control Issue –Smoothness at joints (G: geometry continuity: C: derivative continuity)

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 17/23 Continuity Continuity C k indicates adjacent curves have the same kth derivative at their joints C 0 continuity: Adjacent curves share –Same endpoints: Q i (1) = Q i+1 (0) C -1: discontinuous curves

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 18/23 Continuity C 1 continuity: Adjacent curves share –Same endpoints: Q i (1) = Q i+1 (0) and –Same derivative:Q i’ (1) = Q i+1’ (0) C 2 continuity: –Must have C 1 continuity, and –Same second derivatives: Q i ’’(1) = Q i+1 ’’(0) Most engineering applications (e.g., those in car and airplane industry) require at least C 1 continuity

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 19/23 Splines More useful form of representation compared to the Bezier curve How they work: Parametric curves governed by control points Mathematically: Several representations to choose from. More complicated than vertex lists. See chapter 22 of the book for more information. Simple parametric representation: Advantage: Smooth with just a few control point Disadvantage: Can be hard to control Uses: –representation of smooth shapes. Either as outlines in 2D or with Patches or Subdivision Surfaces in 3D –animation Paths –approximation of truncated Gaussian Filters

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 20/23 A Simple Animation Example Problem: create a car animation that is driving up along the y-axis with velocity [0, 3], and arrive at the point (0, 4) at time t=0. Animate its motion as it turns and slows down so that at time t=1, it is at position (2, 5) with velocity [2, 0]. Solution –First step: generate a mathematical description. –Second step: choose the curve representation Hermite curve: r(t)=GMT(t) Exercise: Bezier curve representation?

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 21/23 Catmull Rom Spline Can be used to solve the following problem. Solution: –Math representation –Curve construction Catmull Rom spline to construct the vectors from the two or three neighbors take home exercise: read chap 22 in the book and construct the curve and the B-spline using the Chen code.

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 22/23 Subdivision curves A simple idea –Using the midpoint of the edge from one point to the next, replace that point with a new one to create a new polygon to construct a new curve. –problem with this? Further readings: –Laplacian interpolation and smoothing (Gabriel Brown) –Joe Rice (on mesh)

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 23/23 Surfaces Curves -> Surfaces Bezier patch: –16 points –Check out the Chen code for surface construction