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:

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
Geometric Modeling Notes on Curve and Surface Continuity Parts of Mortenson, Farin, Angel, Hill and others.
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
© University of Wisconsin, CS559 Spring 2004
B-Spline Blending Functions
1 Introduction Curve Modelling Jack van Wijk TU Eindhoven.
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.
Lecture 29 of 42 Bezier Curves and Splines Wednesday, 02 April 2008
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Curves Week 12, Wed Apr.
Rational Bezier Curves
Offset of curves. Alina Shaikhet (CS, Technion)
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 12: Spline Curves (review) Ravi Ramamoorthi Most material.
Modeling of curves Needs a ways of representing curves: Reproducible - the representation should give the same curve every time; Computationally Quick;
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.
Cubic Bezier and B-Spline Curves
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.
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
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.
(Spline, Bezier, B-Spline)
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.
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.
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.
Computer Graphics Representing Curves and Surfaces.
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.
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.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
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.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 12: Curves 1
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Introduction to Parametric Curve and Surface Modeling.
© University of Wisconsin, CS559 Spring 2004
Introduction to Parametric Curve and Surface Modeling
Curve & Surface.
(Spline, Bezier, B-Spline)
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
CSCE 441: Keyframe Animation/Smooth Curves (Cont.)
Three-Dimensional Object Representation
Lecture 21: B Spline Curve
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

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

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

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

Sub-Dividing Bezier Curves P0P0 P1P1 P2P2 P3P3 M 01 M 12 M 23 M 012 M 123 M 0123

Sub-Dividing Bezier Curves P0P0 P1P1 P2P2 P3P3

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

Longer Curves A single cubic Bezier or Hermite curve can only capture a small class of curves 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 Alternate, most common 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 Curve “knot” P 0,0 P 0,1 P 0,2 P 0,3 P 1,0 P 1,1 P 1,2 P 1,3

Continuity When two curves are joined, we typically want some degree of continuity across the boundary (the knot) –C 0, “C-zero”, point-wise continuous, curves share the same point where they join –C 1, “C-one”, continuous derivatives, curves share the same parametric derivatives where they join –C 2, “C-two”, continuous second derivatives, curves share the same parametric second derivatives where they join –Higher orders possible Question: How do we ensure that two Hermite curves are C 1 across a knot? Question: How do we ensure that two Bezier curves are C 0, or C 1, or C 2 across a knot?

Achieving Continuity For Hermite curves, the user specifies the derivatives, so C 1 is achieved simply by sharing points and derivatives across the knot For Bezier curves: –They interpolate their endpoints, so C 0 is achieved by sharing control points –The parametric derivative is a constant multiple of the vector joining the first/last 2 control points –So C 1 is achieved by setting P 0,3 =P 1,0 =J, and making P 0,2 and J and P 1,1 collinear, with J-P 0,2 =P 1,1 -J –C 2 comes from further constraints on P 0,1 and P 1,2

Bezier Continuity P 0,0 P 0,1 P 0,2 J P 1,1 P 1,2 P 1,3 Disclaimer: PowerPoint curves are not Bezier curves, they are interpolating piecewise quadratic curves! This diagram is an approximation.

DOF and Locality The number of degrees of freedom (DOF) can be thought of as the number of things a user gets to specify –If we have n piecewise Bezier curves joined with C 0 continuity, how many DOF does the user have? –If we have n piecewise Bezier curves joined with C 1 continuity, how many DOF does the user have? Locality refers to the number of curve segments affected by a change in a control point –Local change affects fewer segments –How many segments of a piecewise cubic Bezier curve are affected by each control point if the curve has C 1 continuity? –What about C 2 ?

Geometric Continuity Derivative continuity is important for animation –If an object moves along the curve with constant parametric speed, there should be no sudden jump at the knots For other applications, tangent continuity might be enough –Requires that the tangents point in the same direction –Referred to a G 1 geometric continuity –Curves could be made C 1 with a re-parameterization –The geometric version of C 2 is G 2, based on curves having the same radius of curvature across the knot What is the tangent continuity constraint for a Bezier curve?

Bezier Geometric Continuity P 0,0 P 0,1 P 0,2 J P 1,1 P 1,2 P 1,3

B-splines To piece many Bezier curves together with continuity requires satisfying a large number of constraints –The user cannot arbitrarily move control vertices and automatically maintain continuity B-splines automatically take care of continuity, with exactly one control vertex per curve segment –Many types of B-splines: degree may be different (linear, quadratic, cubic,…) and they may be uniform or non-uniform –We will only look closely at uniform B-splines –With uniform B-splines, continuity is always one degree lower than degree of curve pieces Linear B-splines have C 0 continuity, cubic have C 2, etc

B-spline Curves Curve: –n is the total number of control points –d is the order of the curves, 2  d  n+1 –B k,d are the B-spline blending functions of degree d-1 –P k are the control points –Each B k,d is only non-zero for a small range of t values, so the curve has local control –Each B k,d is obtained by a recursive definition, with “switches” at the base of the recursion The switches make sure that the curve is 0 most of the time

B-Spline Knot Vectors Knots: Define a sequence of parameter values at which the blending functions will be switched on and off –Knot values are increasing, and there are n+d+1 of them, forming a knot vector: (t 0,t 1,…,t n+d ) with t 0  t 1  …  t n+d –Curve only defined for parameter values between t d-1 and t n+1 –These parameter values correspond to the places where the pieces of the curve meet –More precise definition than the one given for the Bezier case

B-Spline Blending Functions The recurrence relation starts with the 1st order B-splines, just boxes, and builds up successively higher orders This algorithm is the Cox - de Boor algorithm –Carl de Boor is in the CS department here at Madison

Uniform Cubic B-splines Uniform cubic B-splines arise when the knot vector is of the form (-3,-2,-1,0,1,…,n+1) Each blending function is non-zero over a parameter interval of length 4 All of the blending functions are translations of each other –Each is shifted one unit across from the previous one –B k,d (t)=B k+1,d (t+1) The blending functions are the result of convolving a box with itself d times, although we will not use this fact