Curves-Computer Graphics-Lecture Notes, Study notes of Computer Graphics

Computer Graphics involves technology to accept, process, transform and present information in a visual form that also concerns with producing images and animations using a computer. This course teach how to make your own design in computer using OpenGl. This lecture includes: Parametric, Equations, Curve, Tangent, Hermite, Blending, Functions, Definition, Bzier, Nurbs

Typology: Study notes

2011/2012

Uploaded on 08/04/2012

parnashi
parnashi ๐Ÿ‡ฎ๐Ÿ‡ณ

4.4

(49)

71 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture No.35 Curves
We all know what a curve is. In this lecture we will explore the mathematical definition
of a curve in a form that is very useful to geometric modeling and other computer
graphics applications: that definition consists of a set of parametric equations. The
mathematics of parametric equations is the basis for Bezier, NURBS (Non Uniform
Rational Beta Splines), and Hermite curves. We will discuss both plane curves and space
curves here and also discussion of the tangent vector, blending functions, conic curves,
re-parameterization, and continuity and composite curves.
Parametric Equations of a Curve
A parametric curve is one whose defining equations are given in terms of a single,
common, independent variable called the parametric variable. We have already
encountered parametric variables in earlier discussions of vectors, lines, and planes.
Imagine a curve in three-dimensional space, each point on the curve has a unique set of
coordinates: a specific x value, y value, and z value. Each coordinate is controlled by a
separate parametric equation, whose general form looks like
)1()(),(),( ๎˜‚๎˜‚๎˜‚uzzuyyuxx
where x(u) stands for some as yet unspecified function in which u is the independent
variable; for example, x(u) = au2+ bu + c, and similarly
for y(u) and z(u). It is important to understand that each
of these is an independent expression. This will become
clear as we discuss specific examples later.
The dependent variables are the x,y, and z coordinates
themselves, because their values depend on the value of
the parametric variable u. Engineers and programmers
who do geometric modeling usually prefer these kinds of
expressions because the coordinates x, y, and z are
independent of each other, and each is defined by its own
parametric equation.
Figure 1: point of a curve defined by a vector.
Each point on a curve is defined by a vector p (figure 1). The components of this vector
are x(u), y(u), and z(u). We express this as
)2()( ๎˜‚๎˜‚๎˜‚upp
Which says that the vector p is a function of the parametric variable u.
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Curves-Computer Graphics-Lecture Notes and more Study notes Computer Graphics in PDF only on Docsity!

Lecture No.35 Curves

We all know what a curve is. In this lecture we will explore the mathematical definition of a curve in a form that is very useful to geometric modeling and other computer graphics applications: that definition consists of a set of parametric equations. The mathematics of parametric equations is the basis for Bezier, NURBS (Non Uniform Rational Beta Splines), and Hermite curves. We will discuss both plane curves and space curves here and also discussion of the tangent vector, blending functions, conic curves, re-parameterization, and continuity and composite curves. Parametric Equations of a Curve A parametric curve is one whose defining equations are given in terms of a single,common, independent variable called the parametric variable. We have already encountered parametric variables in earlier discussions of vectors, lines, and planes.Imagine a curve in three-dimensional space, each point on the curve has a unique set of coordinates: a specific x value, y value, and z value. Each coordinate is controlled by a separate parametric equation, whose general form looks like

x  x ( u ), y  y ( u ), z  z ( u ) ( 1 )

where x(u) stands for some as yet unspecified function in which u is the independent variable; for example, x(u) = au^2 + bu + c, and similarly for y(u) and z(u). It is important to understand that each of these is an independent expression. This will become clear as we discuss specific examples later. The dependent variables are the x,y, and z coordinates themselves, because their values depend on the value of the parametric variable u. Engineers and programmerswho do geometric modeling usually prefer these kinds of expressions because the coordinates x, y, and z are independent of each other, and each is defined by its own parametric equation.

Figure 1 : point of a curve defined by a vector. Each point on a curve is defined by a vector p (figure 1). The components of this vector are x(u), y(u), and z(u). We express this as

p  p ( u ) ( 2 )

Which says that the vector p is a function of the parametric variable u.

docsity.com

There is a lot of information in equation 2. When we expand it into component form, it becomes p ( u )[ x ( u ) y ( u ) z ( u )] ( 3 )

The specific functions that define the vector components of p determine the shape of the curve. In fact, this is one way to define a curve โ€“ by simple choosing or designing these mathematical functions. There re only a few simple rules that we must follow: 1) defineeach component by a single, common parametric variable, and 2) make sure that each point on the curve corresponds to a unique value of the parametric variable. The last rule can be put another way: each value of the parametric variable must correspond to a unique point on the curve. Plane Curves To define plane curves, we use parametric functions that are second-degree polynomials:

z z z

y y y

x x x

z u au bu c

y u a u b u c

x u a u bu c

2

2

2

Where the a, b, and c terms are constant coefficients.We can combine x(u), y(u), z(u), and their respective coefficients into and equivalent, more concise, vector equation:

P ( u ) au^2  bu  c ( 5 )

We allow the parametric variable to take on values only in the interval 0  u  1. This ensures that the equation produces a bounded line segment. The coefficients a, b, c, in this equation are vectors, and each has three components; for example, a = [ax ay a (^) z ]. This curve has serious limitations. Although it can generate all the conic curves, or a close approximation to them, it cannot generate curve with an inflection point, like an S- shaped curve, no matter what values we select for the coefficients a, b, c. to do this requires a cubic polynomial. How do we define a specific plane curve, one that we can display, with define end points, and a precise orientation in space? first, note in equation 4 or 5 that there are nine coefficients that we must determine: ax, b (^) x, โ€ฆ, c (^) z. if we know the two end points and the intermediate point. End points and an intermediate point on the curve, then we now nine quantities that we can express in terms of these coefficients (3 points x 3 coordinates each = 9 known quantities), and we can use these three points to define a unique curve (Figure 2). By applying some simple algebra to these relationships, we can rewrite Equation 5 in terms

docsity.com

Using this result and equivalent expressions for y(u) and z(u), we combine them into a single vector equation: P(u) = (2u^2 โ€“ 3u + 1) P 0 + (-4u 2 + 4u)P (^) 0.5 + (2u 2 โ€“ u) P1 (11) Equation 11 produces the same curve as Equation 5. The curve will always lie in a plane no matter what three points we choose, Furthermore, it is interesting to note that the point P (^) 0.5 which is on the curve a t u= 0.5, is not necessarily half way along the length of the curve between p0 and p1. We can show this quite convincingly by choosing three points to define a curve such that two of them are relatively close together (figure 3). In fact, if we assign a different value to the parametric variable for the intermediate point, then we obtain different values for the coefficients in equations 8. This, in turn, means that a different curve is produced, although it passes through the same three points. Equation 5 is the algebraic form and equation 11 is the geometric form. Each of these equations can be written more compactly with matrices. Compactness is not the only advantage to matrix notation. Once a curve is defined in matrix form, we can use the full power of matrix algebra to solve many geometry problems.

Figure 3 : Curve defined by three non-uniformly spaced points. So now we rewrite equation 5 using the following substitutions:

[ 2 1 ] au^2 bu c ( 12 ) c

b

a u u    

U [ u^2 u 1 ] ( 13 )

A [ a b c ] T ( 14 )

docsity.com

And finally we obtain

p ( u ) UA ( 15 )

Remember that A is really a matrix of vectors, so that

x y z

x y z

x y z

c c c

b b b

a a a

c

b

a A

The nine terms on the right are called the algebraic coefficients. Next, we convert equation 11 into matrix form. The right-hand side looks like the product of two matrices: [( 2 u^2 3 u  1 ) ( 4 u^2  4 u ) ( 2 u^2 u )] and [ p 0 (^) p 0. 5 p 1 ]. This means that

( ) [( 2 3 1 ) ( 4 4 ) ( 2 )] ( 17 )

1

  1. 5

0 (^2 22)  

p

p

p pu u u u u u u

Using the following substitutions:

F [( 2 u^2 3 u  1 ) ( 4 u^2  4 u ) ( 2 u^2 u )] ( 18 ) and

1 1 1

  1. 5 0. 5 0. 5

0 0 0

1

  1. 5

0   

x y z

x y z

x y z

p

p

p p

where P is the control point matrix and the nine terms on the right are its elements or the geometric coefficients, we can now write

p ( u ) FP ( 20 )

This is the matrix version of the geometric form. Because it is the same curve in algebraic form, p(u)=UA, or geometric form, p(u)=FP, we can write

FP  UA ( 21 ) The F matrix is itself the product of two other matrices:

docsity.com