Cubic Space Curves: Deriving Hermite Basis Matrix and Blending Polynomials, Study notes of Computer Graphics

Cubic space curves and their representation in vector and matrix forms. It also covers the derivation of the hermite basis matrix and blending polynomials, which are essential for understanding hermite curves and their applications in computer graphics and animation.

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-oql
koofers-user-oql 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Cubic Space Curves
Consider coordinate functions that are cubic polynomials
Each is a linear combination of monomial terms
where
32
3210
32
3210
32
3210
=+++
=+++ 01
=+++
()
()
()
xu au au au a
yu bu bu bu b u
zu cu cu cu c
3
=0
3
=0
3
=0
=
=
=
¦
¦
¦
()
()
()
i
i
i
i
i
i
i
i
i
xu au
yu bu
z
ucu
Vector/Matrix Forms for Cubic Curves
For convenience, we can rewrite in vector form
And in an even more condensed matrix form
T
0
1
23
2
3
ªº
«»
«»
ªº
=1 =
¬¼
«»
«»
¬¼
()uuuu
a
a
puA
a
a
2
3
1
ªº
«»
«»
=«»
«»
¬¼
u
u
u
u
32
3210
3
=0
=+++
=¦
()
i
i
i
uuuu
u
paaaa
a
ªº
«»
=«»
«»
¬¼
i
ii
i
a
b
c
a
333
=0 =0 =0
===
¦¦¦
() () ()
iii
iii
iii
xu au yu bu zu cu
Rewriting with Geometric Constraints
Recall that a cubic is determined by 4 constraint points
want to rewrite spline formulas in terms of these constraints
not the coefficients of the monomial terms
P
T
geometry matrix
basis matrix
11 12 13 14 1
21 22 23 24 2
23
31 32 33 34 3
41 42 43 44 4
ªº
ªº
«»
«»
«»
«»
ªº
=1 =
¬¼
«»
«»
«»
«»
¬¼
¬¼

()
mmmm
mmmm
uuuu
mmmm
mmmm
g
g
puMG
g
g
TT
== =()up uAuMG AMG
Hermite Curves
Specify 4 geometry constraints
endpoints of the curve segment
tangent vectors at each of the endpoints
Easy to paste Hermite segments together
specify coincident endpoints and identical tangents
guarantees tangents are continuous — C1continuity
0
3
0
3
=0
=1
=0
=1
()
()
'( )
'( )
pp
pp
rp
rp
0
p
3
p
0
r3
r
0
3
0
3
ª
º
«
»
«
»
=
«
»
«
»
¬
¼
p
p
Gr
r
pf3
pf4

Partial preview of the text

Download Cubic Space Curves: Deriving Hermite Basis Matrix and Blending Polynomials and more Study notes Computer Graphics in PDF only on Docsity!

Cubic Space Curves Consider coordinate functions that are cubic polynomialsEach is a linear combination of monomial terms

where 3 23 2

1 0 3 23 2

1 0 3 23 2

1 0 =^ +^

+^ +

=^ +^

+^ +^

0 ≤^ ≤ 1

=^ +^

+^ +

(^ ) x u^ a u (^ ) (^ )

a u^

a u^ a y u^ b u

b u^

b u^ b^

u

z u^ c u

c u^

c u^ c 3 = ƒ=0 3 =ƒ=0 3 =ƒ=

(^ ) (^ ) (^ )

iii iii iii x u^

a u y u^

b u z u^

c u

Vector/Matrix Forms for Cubic Curves For convenience, we can rewrite in vector formAnd in an even more condensed matrix form

0 T 1 2 3

»^ º …^ »…^ »^23

»^

= 1^

¬^

¼ …^ » …^ »¬^ ¼

(^ ) u^

u^ u^ u

a a p^

u Aa a

(^1) » º … » u … »= (^) u^2 … » u … »^3 u ¬ ¼

3 23 2

1 0 =^ +^3 =

+^ +

(^ ) u^ u^ i =^ ƒ ii

u^ u u p^ a^

a^ a^

a a

»^ º a^ i …^ »= b a i i …^ »…^ » c ¬^ ¼ i

3

3

3

=^

=^

=

=^

=^

ƒ^

ƒ^

(^ )^

(^ )^

(^ )

i^

i^

i

i^

i^

i

i^

i^

i

x u^

a u^ y u

b u

z u^

c u

Rewriting with Geometric Constraints Recall that a cubic is determined by 4 constraint points^ • want to rewrite spline formulas in terms of these constraints•^ not^

the coefficients of the monomial terms

P

T geometry matrix 11 12 basis matrix

13 14

1 21 22

23 24

2

2 3

31 32

33 34

3 41 42

43 44

4

»^

º »^ º

…^

» …^ »

…^

» …^ »

»^

= 1^

¬^

¼ …^

» …^ »

…^

» …^ »¬^ ¼

¬^

(^ )

m^ m^

m^ m m^ m^

m^ m

u^ u

u^ u^

m^ m^

m^ m m^ m^

m^ m

g g

p^

u MGg g

T^ T = =^

Ω^ =

(^ ) u p u A

u MG

A^

MG

Hermite Curves Specify 4 geometry constraints^ • endpoints of the curve segment• tangent vectors at each of the endpoints Easy to paste Hermite segments together^ • specify coincident endpoints and identical tangents• guarantees tangents are continuous —

(^1) C continuity

=^0 ( ) p p 0 =^1 ( ) p p 3 =^0 '( ) r p 0 =^1 '( ) r p 3

p^^0

p^3 r^^0

r^3

p » º^0 … » p^3 … »= (^) G … » r^0 … » r^3 ¬ ¼

Deriving the Hermite Basis Matrix These are the constraints that we want:We can rewrite this as:

0

0 3

1 0

2 3

3 1 0 0

»^ º^

»^ º

»^

…^ »^

…^ »

…^

…^ »^

…^ »

…^

…^ »

…^

…^ »^

…^ »

…^

¬^

¬^ ¼^

¬^ ¼

p^

a p^

a r^

a r^

a 0

0 3

3 2

1 0 0

1 3

3 1

1 =^ 0 ==^ 1 =^

+^ +^

=^ 0 ==^ 1 = 3

( )( )'( )^ + 2^ +'( )

p^ p^

a p^ p^

a^ a^

a^ a r^ p^

a r^ p^

a^ a^

a

3 23 2

1 0 =^ +^

+^ +

(^ ) u^ u

u^

u p^ a^

a^ a^

a

Deriving the Hermite Basis Matrix Starting from here, we invert the coefficient matrix …… and solve for the spline coefficient matrix

C

0

0 3

1 0

2 3

3 1 0 0

»^ º^

»^ º

»^

…^ »^

…^ »

…^

…^ »^

…^ »

…^

…^ »

…^

…^ »^

…^ »

…^

¬^

¬^ ¼^

¬^ ¼

p^

a p^

a r^

a r^

a − 0

0

0

1

3

3

2

0

0

3

3

3

»^ º^

»^ º^

»^ º

»^

º^

»^

…^ »^

…^ »^

…^ »

…^

»^

…^

…^ »^

…^ »^

…^ »

…^

»^

…^

=^

…^ »^

…^ »^

…^ »

…^

»^

…^

−3^3

−2^ −

…^ »^

…^ »^

…^ »

…^

»^

…^

2 −^

¬^

¼^

¬^

¬^ ¼^

¬^ ¼^

¬^ ¼

a^

p^

p

a^

p^

p

a^

r^

r

a^

r^

r

The Equation for a Hermite Curve We’re done! The curve, in terms of the constraints isWe can also look at it as a weighted sum of the constraints^ • each is weighted by a blending function• whose coefficients are the columns of the basis matrix

3 2

3 2

3 2

3 2

0

3

0

3

1 0 2

3 3 0

4 3 = 2^ − 3

+^

+ −2^ + 3

+^

− 2^ +^

+^ −

=^ +^

+^ +

(^ )^ (^

)^ (^

)^ (^

)^ (^

u^ u^

u^

u^ u^

u^ u^

u^ u

u

h^ h^

h^ h p^

p^

p^

r^

r

p^ p^

r^ r

0 3

2 3

0 3 1 0

»^

º …^ »

…^

…^

»^

= 1¬^

¼^

…^ »

…^

−3^3

−2^ −1^ …

…^

2 −^

¬^

¼ ¬^ ¼

(^ ) u^

u^ u^ u

p p

p^

r r

Hermite Blending Polynomials^1

(^ ) h u^ 1

(^ ) h u (^2) ( ) h u 3 ( ) h u 4

3 2 1

3 2 2 3 2 3 3 2 = 2^4

− 3^ +1= −2 + 3= − 2^ + = −

(^ ) h u^ u^ (^ ) (^ ) (^ )

u h^ u^

u^ u h^ u^ u

u^

u h^ u^ u

u

Exercise: Bézier Continuity Suppose that you’re given two cubic Bézier control polygonswhere the two curves

p^ and^ q

should be joined consecutively.

What constraints on these points are necessary to guarantee^1 C^ continuity between them?

0 1 2

3 0 1 2

3 ,^ ,^ , p p^ p^ p ,^ ,^ , q q^ q^ q

Catmull–Rom Splines Given a set of points in space, suppose we want a spline that^ • interpolates the data points

[rules out Bézier]

(^1) • with C continuity

[Hermite: lots of tweaking]

This is a common situation in animationWe start with the given set of points

define tangent ,^ ,^

(^

n^

i^ i^

i s

0

=^ −+1^ −

p^ p^

r^ p^

p

Catmull–Rom Splines Typically, we pick

s^ =^ ½ and we can derive a spline equation More generally, we can use any tension parameter

−3 −2 s

2 3

− 0 2

»^

º …^ »

…^

−1^0

…^ »

…^

»^

=^1 ¬^

¼^

…^ »

…^

2 −^

…^ »

…^

−1^3

−3^1

¬^

¼ ¬^ ¼

(^ )

i i i i

u^

u^ u^ u

p p

p^

p p^ −3 −

2 3

− 0 1

»^ º

»^

º …^ »

…^

−^0

0 …^ »

…^

»^

= 1¬^

¼^

…^ »

…^

3 − 2^

−^ …^

…^

−^ 2 −^

¬^

¼ ¬^ ¼

(^ )

i i i i s^

s

u^ u^ u^ u

s^ s

s^ s s^ s^

s^ s

p p

p^

p p