Computer Graphics Lecture 38

Slides:



Advertisements
Similar presentations
Lecture Notes #11 Curves and Surfaces II
Advertisements

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.
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
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
Jehee Lee Seoul National University
Dr. S.M. Malaek Assistant: M. Younesi
08/30/00 Dinesh Manocha, COMP258 Hermite Curves A mathematical representation as a link between the algebraic & geometric form Defined by specifying the.
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
AN INTRODUCTION BEZIER CURVES. AN INTRODUCTION BEZIER CURVES Bezier was an engineer with the Renault car company and set out in the early 1960's to develop.
09/04/02 Dinesh Manocha, COMP258 Bezier Curves Interpolating curve Polynomial or rational parametrization using Bernstein basis functions Use of control.
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
Bezier and Spline Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Modelling: Curves Week 11, Wed Mar 23
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
COEN Computer Graphics I
Splines III – Bézier Curves
Preview of Calculus.
Curve Modeling Bézier Curves
Curve Modeling B-Spline Curves
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
This Week Week Topic Week 1 Week 2 Week 3 Week 4 Week 5
(Spline, Bezier, B-Spline)
V. Space Curves Types of curves Explicit Implicit Parametric.
Introduction to Computer Graphics with WebGL
Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.
Chapter VI Parametric Curves and Surfaces
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.
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.
Keyframing and Splines Jehee Lee Seoul National University.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Representation of Curves & Surfaces Prof. Lizhuang Ma Shanghai Jiao Tong University.
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.
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
© University of Wisconsin, CS559 Spring 2004
CS 445 / 645 Introduction to Computer Graphics
Parametric Curves cgvr.korea.ac.kr.
(Spline, Bezier, B-Spline)
Chapter 10-2: Curves.
Computer Graphics Lecture 37
CSE 167 [Win 17], Lecture 9: Curves 1 Ravi Ramamoorthi
CS 430/536 Computer Graphics I Intro to Curves Week 4, Lecture 7
Copyright © Cengage Learning. All rights reserved.
Trigonometric Identities
Parametric Curves.
© University of Wisconsin, CS559 Fall 2004
Rendering Curves and Surfaces
© University of Wisconsin, CS559 Spring 2004
Chapter XVII Parametric Curves and Surfaces
Curves and Surfaces.
Computer Graphics Lecture 36 CURVES II Taqdees A. Siddiqi
UNIT-5 Curves and Surfaces.
Three-Dimensional Object Representation
Computer Aided Geometric Design
Introduction to Parametric Curve and Surface Modeling
Overview June 9- B-Spline Curves June 16- NURBS Curves
Presentation transcript:

Computer Graphics Lecture 38

CURVES IV Taqdees A. Siddiqi cs602@vu.edu.pk

Bezier Curves

The Bezier curve is an important part of almost every computer-graphics illustration program and computer-aided design system in use today

It is used in many ways, from designing the curves and surfaces of automobiles to defining the shape of letters in type fonts.

Because it is numerically the most stable of all the polynomial-based curves used in these applications, the Bezier curve is the ideal standard for representing the more complex piecewise polynomial curves.

In the early 1960s, Peter Bezier began looking for a better way to define curves and surfaces one that would be useful to a design engineer

A Geometric Construction

We can draw a Bezier curve using a simple recursive geometric construction. Let’s begin by constructing a second-degree curve.

We select three points A, B, C so that line AB is a tangent to the curve at A, and BC is tangent at C. The curve begins at A and ends at C.

Figure 1: Geometric Construction of a second-degree Bezier curve.

For any ratio, ui, we construct points D and E such that: Equation 1

On DE we construct F so that DF/DE = uj. Point F is on the curve. Repeating this process for other values of ui, we produce a series of points on a Bezier curve.

Figure 1: Geometric Construction of a second-degree Bezier curve.

Note that we must be consistent in the order in which we sub-divide AB and BC. For example here first, AB is divided into AD & DB And then BC into BE & EC And finally DE into DF & FE

To define this curve in a coordinate system, let point A = (xA, yA), B = (xB, yB)

Then coordinates of points D and E for some value of ui are Equation 2

And Equation 3

The coordinates of point F for some value of ui are Equation 4

To obtain xF and yF in terms of the coordinates of points A, B and C, for any value of ui in the unit interval, we substitute appropriately from Equation 2 and 3 into equation 4 of plane curve. After rearranging terms to simplify, we find

Equation 5

We generalize this set of equations for any point on the curve using the following substitutions:

Equation 6

And we let Equation 7

Now we can rewrite Equation 5 as

This is the set of second-degree equations for the coordinates of points on Bezier curve based on our construction

We express this construction process and Equations 8 in terms of vectors with the following substitutions.

Let the vector po represent point A, p1 point B, and p2 point C.

Form vector geometry we have , and , if we let we see that

Equation 9

We rearrange terms to obtain a more compact vector equation of a second degree Bezier curve:

Equation 10

Where the points p0, p1 and p2 are called control points, and p is the point on the curve. The ratio u is the parametric variable that takes its value in the range [0,1]

Later we will see that this equation is an example of a Bernstein polynomial.

Similar constructions apply to Bezier curves of any degree Similar constructions apply to Bezier curves of any degree. In fact the degree of a Bezier curve is equal to n-1, where n is the number of control points.

Figure 2 shows the construction of point on a cubic Bezier curve, which requires four control points A, B, C, and D to define it. The curve begins at point A tangent to the, AB, and ends at D and tangent to CD. We construct points E, F, and G such that

Equation 11

Figure 2: Geometric Construction of a cubic Bezier curve.

On EF and FG we locate H and I, respectively, such that Equation 12

Finally on HI we locate J such that Equation 13

We can make no more subdivisions, which means that point J is on the curve. If we continue this process for a sequence of points, then their locus defines the curve.

If points A, B, C, and D are represented by the vectors p0 p1, p2 and p3 respectively, then expressing the construction of the intermediate points E, F, G, H, and I in terms of these vectors to produce point J, or P(u), yields

Equation 14

This awkward expression simplifies nicely to Equation 15

The geometric construction of a Bezier curve shows how the control points influence its shape. The curve begins at the first point and ends at the last point.

It is tangent to the lines connecting the first two points and the last two points. The curve is always contained within the convex hull of the control points.

An Algebraic Definition

Bezier began with the idea that any point p(u) on a curve segment should be given by an equation such as the following:  

Equation 16

where and vectors pi are the control points (Figure 3).  Equation 16 is a compact way to express the sum of several similar terms because what it says is this:

Figure 3: Bezier curves and their control points.

Equation 17

Of which Equation 10 and 15 are specific examples, for n=2 and n=3, respectively. The n+1 functions, that is the fi(u) must produce a cure that has certain well-defined characteristics. Here are some of the most important ones:

The curve must start on the first control point, p0, and end on the last, pn. Mathematically, we say that the functions must interpolate these two points. The curve must be tangent to the line given by p1 – p0 at p0 and to pn – pn-1 at pn.

The functions fi(u) must be symmetric with respect to u and (1-u) The functions fi(u) must be symmetric with respect to u and (1-u). This lets us reverse the sequence of control points without changing the shape of the curve.

Some Characteristics of Bezier Curves: - End Point Interpolation Affine Invariance (transform ctrl points and redraw – curve keeps shape) Convex Hull Property Linear Precision (ctrl points in st. line) Variation Diminishing

Figure 4: Three different sequences of four control points.

Problem of Local Control Figure 5: Modifying the shape of a Bezier curve

A family of functions called Bernstein polynomials satisfies these requirements. They are the basis functions of the Bezier curve (Other curves, such as the NURBS curves, use different, but related, basis functions).

Figure 6: Bezier curve basis functions

We rewrite Equation 16 using these basis functions as:

Were the basis functions are given as: Equation 19

The term is the binomial coefficient function from probability theory and statistics, defined as  

Equation 20

The symbol. is the factorial operator. For example, 3. = 3 x 2 x 1, 5 The symbol ! is the factorial operator. For example, 3! = 3 x 2 x 1, 5! = 5 x 4 x 3 x 2 x 1, so forth. We use the following conventions when evaluating Equation 20; If i and u equal zero, then ui = 1 and 0! = 1.

We see that for n+1 control points, the basis functions produce an nth-degree polynomial.

Expanding Equation 18 for a second degree Bezier curve (When n=2 and there are three control points) produces

Equation 21

From Equation 20, we find Equation 22

Equation 23 and Equation 24

These are the basis functions for a second-degree Bezier curve These are the basis functions for a second-degree Bezier curve. Substituting them into Equation 21 and rearranging terms, we find  

Equation 25

This is the same expression we found from the geometric construction, Equation 10. The variable u is now called the parametric variable. Now, let’s expand Equation 18 for a cubic Bezier curve, where n=3:

Equation 26

And from Equation 20 we find

Equation 28

Equation 29

Equation 30

Substituting these into Equation 26 and rearranging terms produces

Equation 31

Bezier curve equations are well suited for expression in matrix form Bezier curve equations are well suited for expression in matrix form. We can expand the cubic parametric functions and rewrite Equation 31 as

Equation 32

Equation 33

If we let Equation 34

Equation 35

Equation 36

Then we can write Equation 33 even more compactly as

Note that the composition of the matrices U, M, and P varies according to the number of control points (that is, the degree of the Bernstein polynomial basis functions).

Computer Graphics Lecture 38