You are on page 1of 8

Slide 1 27 October 1999 CS 318 - Computer Graphics (Top Changwatchai)

Review of Spline Concepts


Sections 10-6 to 10-13 in Hearn & Baker
Splines can be 2D or 3D
Control points
Interpolation vs. approximation
Convex hull
Continuity conditions
Local vs. global control
Three methods of specifying splines
Types of splines
Cubic
Bzier
B-splines
Other

Slide 2 27 October 1999 CS 318 - Computer Graphics (Top Changwatchai)
Spline Basics (1/3)
Definitions
Textbook calls a spline curve any composite curve formed
with polynomial sections satisfying specified continuity
conditions at the boundary of the pieces - can be 2D or 3D
Spline surfaces formed from two sets of orthogonal spline
curves
From now on spline refers to spline curve
Control points
Used to specify spline curves
Two ways to fit splines
Interpolation - curve passes through each control point
Approximation - curve does not necessarily pass through any
control point
Convex hull
minimum convex polygon boundary that encloses set of
control points

Slide 3 27 October 1999 CS 318 - Computer Graphics (Top Changwatchai)
Spline Basics (2/3)
Splines are specified using parametric equations
P(u) = [ x(u) y(u) z(u) ] - row vector
P(u) = Au
3
+ Bu
2
+ Cu + D - each of A, B, C, and D are row vectors
From now on, we treat P as scalar:
P(u) = au
3
+ bu
2
+ cu + d
Unless otherwise specified, all derivatives are with respect to parameter u
Continuity conditions (between two curve sections)
parametric
C
0
- same point
C
1
- tangent lines (1
st
derivatives) equal
C
2
- 1
st
and 2
nd
derivatives equal
etc
geometric
G
0
= C
0

parametric derivatives proportional (in same direction) but not necessarily equal:
G
1
, G
2
, etc
note
there exists a case where you can have G
1
continuity without C
1
continuity
Local vs. global control
Global control - if one point altered, the entire curve affected
Local control - only that curve section is affected
Slide 4 27 October 1999 CS 318 - Computer Graphics (Top Changwatchai)
Spline Basics (3/3)
Recall from previous slide
P(u) = au
3
+ bu
2
+ cu + d
We can write as:
P(u) = U Co U = [ u
3
u
2
u 1 ] Co = [ a b c d ]
T

= U M
spline
M
geom

= B M
geom

U is the 14 parameter vector
Co is the 41 coefficient matrix
Three methods of spline specification
Boundary conditions
Description given in English
Actual values placed in 41 geometry vector M
geom

Basis matrix
M
spline
is the 44 basis matrix
This is constant for a given type of spline
Co = M
spline
M
geom

Blending functions
B is a 14 matrix representing the blending functions
B = U M
spline
= [ F
0
(u) F
1
(u) F
2
(u) F
3
(u) ]

Slide 5 27 October 1999 CS 318 - Computer Graphics (Top Changwatchai)
Types of Splines
Why cubic?
Higher order less stable, more complex to calculate
Lower order dont look as good
Cubic is smallest that specifies endpoints and derivatives,
and which is nonplanar in 3D
Cubic splines (interpolation)
Natural
Hermite
Cardinal
Kochanek-Bartels
Bzier (approximation)
B-splines (approximation)
Other


Slide 6 27 October 1999 CS 318 - Computer Graphics (Top Changwatchai)
Review of Cubic Splines
Features
Cubic splines interpolate - passes through every control point
We fit one curve section at a time between each pair of successive control
points (u=0 to u=1)
We have 4 coefficients (cubic) so for n curve sections need 4n boundary
conditions
Natural
Boundary conditions: endpoints on control points, 1st and 2nd parametric
derivatives match between adjacent curve sections
Bad: exhibits global control
Hermite
Boundary conditions: endpoints on control points, parametric slope
specified at control points
Exhibits local control, but may be inconvenient to specify slopes
Cardinal
Same as Hermite, but we compute tangents from neighboring control points
Has tension parameter t
Kochanek-Bartels
Same as cardinal but adds two additional parameters, bias and continuity
Good for modelling abrupt changes





Slide 7 27 October 1999 CS 318 - Computer Graphics (Top Changwatchai)
Bzier Curves - Features
Approximation
Global control
Number of control points determines degree of Bzier
curve
Easy to implement and calculate recursively
Always passes through first and last control points
Lies within convex hull
Easy to connect sections together

Slide 8 27 October 1999 CS 318 - Computer Graphics (Top Changwatchai)
Note from 27 October lecture
In class we went over how to derive the following boundary conditions from the definition of Bzier curve:
P(0) = p
0
P(1) = p
n

P'(0) = -np
0
+ np
1
P'(1) = -np
n-1
+ np
n


Dr. Chawla points out that there is a simpler (though equivalent) way to view our derivation:





For u = 0, we see that every term except the first has a u and therefore goes to 0.
For u = 1, we see that every term except the last has a (1-u) and therefore goes to 0. So we have:



Taking the parametric derivative, we get:





For u = 0, we see that all terms except the first two have us and therefore go to 0.
For u = 1, we see that all terms except the last two have (1-u)s and therefore go to 0. So we have:


=
=
n
k
n k k
u BEZ u
0
,
) ( p ) ( P
n
n
n
n
n
n
n n n
u
n
n
u u
n
n
u u
n
n
u u
n
u u
n
u
n
u
|
|
.
|

\
|
+
|
|
.
|

\
|

+
|
|
.
|

\
|

+ +
|
|
.
|

\
|
+
|
|
.
|

\
|
+
|
|
.
|

\
|
=


p ) 1 (
1
p ) 1 (
2
p ) 1 (
2
p ) 1 (
1
p ) 1 (
0
p ) ( P
1
1
2 2
2
2 2
2
1
1 0

( ) ( )
( ) ( )
1 1 2
1
2 2 3
2
3 2 2
2
2 1
1
1
0
p ) 1 ( ) 1 )( 1 (
1
p ) 2 )( 1 ( ) 2 ( ) 1 (
2
p
) 2 ( ) 1 ( ) 1 ( 2
2
p ) 1 ( ) 1 ( ) 1 (
1
p ) ( ) 1 (
0
p ) ( P'


|
|
.
|

\
|
+ +
|
|
.
|

\
|

+ +
|
|
.
|

\
|

+
+ + +
|
|
.
|

\
|
+ + +
|
|
.
|

\
|
+
|
|
.
|

\
|
=
n
n
n n
n
n n
n
n n n n n
nu
n
n
u n u u
n
n
u u n u u
n
n
n u u u u
n
n u u u
n
n u
n
u
|
|
.
|

\
|
=
0
p ) 0 ( P
0
n
|
|
.
|

\
|
=
n
n
n
p ) 1 ( P
|
|
.
|

\
|
+
|
|
.
|

\
|
=
1
p ) (
0
p ) 0 ( P'
1 0
n
n
n
n
n
n
n
n
n n
|
|
.
|

\
|
+
|
|
.
|

\
|

=

p ) 1 (
1
p ) 1 ( P'
1

You might also like