CS559: Computer Graphics -...

38
CS559: Computer Graphics Lecture 13: Hierarchical Modeling and Curves Li Zhang Spring 2010

Transcript of CS559: Computer Graphics -...

Page 1: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

CS559: Computer Graphics

Lecture 13: Hierarchical Modeling and Curves

Li Zhang

Spring 2010

Page 2: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Last time: 3D Example:  A robot arm• Consider this robot arm with 3 degrees of freedom:

– Base rotates about its vertical axis by θ– Upper arm rotates in its xy‐plane by φ– Lower arm rotates in its xy‐plane by ψ

h1

h2 h3

Base

Upper armLower arm

ψφ

z

x

y

y

x

θ

x

• Q:  What matrix do we use to transform the base to the world?

• R_y(θ)• Q:  What matrix for the upper arm to the base?

• T(0,h1,0)R_z(φ)• Q:  What matrix for the lower arm to the upper arm?

• T(0,h2,0)R_z(ψ)

Page 3: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Robot arm implementation• The robot arm can be displayed by keeping a global matrix and computing it 

at each step:

Matrix M_model;

display(){

. . .

robot_arm();

. . .

}

robot_arm()

{

M_model = R_y(theta);

base();

M_model = R_y(theta)*T(0,h1,0)*R_z(phi);

upper_arm();

M_model = R_y(theta)*T(0,h1,0)*R_z(phi)*T(0,h2,0)*R_z(psi);

lower_arm();

}

Do the matrix computations seem wasteful?How to translate the whole robot?

• Q:  What matrix do we use to transform the base to the world?

• R_y(θ)• Q:  What matrix for the upper arm to the base?

• T(0,h1,0)R_z(φ)• Q:  What matrix for the lower arm to the upper arm?

• T(0,h2,0)R_z(ψ)

Page 4: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

• Instead of recalculating the global matrix each time, we can just update it in place by concatenating matrices on the right:

Robot arm implementation, better

Matrix M_model;

display(){

. . .

M_model = identity;

robot_arm();

. . .

}

robot_arm()

{

M_model *= R_y(theta);

base();

M_model *= T(0,h1,0)*R_z(phi);

upper_arm();

M_model *= T(0,h2,0)*R_z(psi);

lower_arm();

}

Page 5: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

• OpenGL maintains the model‐view matrix, as  a global state variable which is updated by concatenating matrices on the right.  

display()

{

. . .

glMatrixMode( GL_MODELVIEW );

glLoadIdentity();

robot_arm();

. . .

}

robot_arm()

{

glRotatef( theta, 0.0, 1.0, 0.0 );

base();

glTranslatef( 0.0, h1, 0.0 );

glRotatef( phi, 0.0, 0.0, 1.0 );

lower_arm();

glTranslatef( 0.0, h2, 0.0 );

glRotatef( psi, 0.0, 0.0, 1.0 );

upper_arm();

}

Robot arm implementation, OpenGL

Page 6: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Hierarchical modeling

• Hierarchical models can be composed of instances using trees:

– edges contain geometric transformations– nodes contain geometry (and possibly drawing attributes)

How might we draw the tree for the car?

Page 7: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

A complex example: human figure

• Q:  What’s the most sensible way to traverse this tree?

Page 8: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Human figure implementation, OpenGLfigure()

{

torso();

glPushMatrix();

glTranslate( ... );

glRotate( ... );

head();

glPopMatrix();

glPushMatrix();

glTranslate( ... );

glRotate( ... );

left_upper_arm();

glPushMatrix();

glTranslate( ... );

glRotate( ... );

left_lower_arm();

glPopMatrix();

glPopMatrix();

. . .

}

Page 9: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Curves

x

y

line circlex

y

Freeformx

y

Page 10: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Curve Representation

x

y

line

baxy +=

circlex

y

0)()(),( 222 =−−+−= rdycxyxf0),( =+−= byaxyxf

⎥⎦

⎤⎢⎣

⎡⋅⋅

+⎥⎦

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡trtr

dc

yx

sincos

c

d t

c

dtθ

⎥⎦

⎤⎢⎣

⎡⋅+⎥

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡θθ

sincos

tdc

yx

Explicit:

Implicit:

Parametric:

Page 11: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Curve Representation

x

y

line circlex

y

⎥⎦

⎤⎢⎣

⎡⋅⋅

+⎥⎦

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡trtr

dc

yx

2sin2cos

c

d t

c

dtθ

⎥⎦

⎤⎢⎣

⎡⋅+⎥

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡θθ

sincos

2tdc

yx

Parametric:

Page 12: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Curve Representation

x

y

line circlex

y

⎥⎦

⎤⎢⎣

⋅⋅

+⎥⎦

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡3

3

sincos

trtr

dc

yx

c

d t

c

dtθ

⎥⎦

⎤⎢⎣

⎡⋅+⎥

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡θθ

sincos3t

dc

yx

Parametric:

Page 13: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Curve Representation

x

y

line circlex

y

⎥⎦

⎤⎢⎣

⎡⋅⋅

+⎥⎦

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡)(sin)(cos

tgrtgr

dc

yx

c

d t

c

dtθ

⎥⎦

⎤⎢⎣

⎡⋅+⎥

⎤⎢⎣

⎡=⎥

⎤⎢⎣

⎡θθ

sincos

)(tgdc

yx

Parametric:

Any invertible function g will result in the same curve

Page 14: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

What are Parametric Curves?

• Define a mapping from parameter space to 2D or 3D points– A function that takes parameter values and gives back 3D points

• The result is a parametric curve

0 t1

Mapping:F:t→(x,y,z)

0

1(Fx(t), Fy(t), Fz(t),)

Page 15: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

An example of  a complex curve

⎩⎨⎧

>−≤

=5.0)12(5.0)2(

)(tttt

tcircle

line

ff

f

Piecing together basic curves

Page 16: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Continuities

⎩⎨⎧

>−≤

=5.0)12(5.0)2(

)(tttt

tcircle

line

ff

f

)0()1(:0circleline

C ff =

)0()1(:1 ''circleline

C ff =

)0()1(:2 ''''circleline

C ff =

)0()1(:1 ''circleline

kG ff ⋅=

)0()1(:2 ''''circleline

kG ff ⋅=

Page 17: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Polynomial Pieces

nntatataatf ++++= L2

210)(

3

0)( Rtt i

n

i

ii ∈=∑

=

aaf

Polynomial functions:

Polynomial curves:

Page 18: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Polynomial Evaluation

nntatataatf ++++= L2

210)(Polynomial functions:

f = a[0];for i = 1:n

f += a[i]*power(t,i);end

f = a[0];s = 1;for i = 1:n

s *= t;f += a[i]*s;

end

( )11210)( −++++= n

ntataatatf L

( )( )( )nnn taataatatatf +++++= −− 12210)( L

( )( )23210)( −++++= n

ntataatatatf L

f = a[n];for i = n‐1:‐1:0

f = a[i]+t*f;end

Page 19: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

A line Segment

• We have seen the parametric form for a line:

• Note that x, y and z are each given by an equation that involves:– The parameter t

– Some user specified control points, x0 and x1• This is an example of a parametric curve

10

10

10

)1()1()1(

tzztztyytytxxtx

+−=+−=+−=

10)1()( ppfp ⋅+⋅−== tttp0

p1

Page 20: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

A line Segment

• We have seen the parametric form for a line:

10

10

10

)1()1()1(

tzztztyytytxxtx

+−=+−=+−=

10)1()( ppfp ⋅+⋅−== tttp0

p1

)()( 010 pppfp −⋅+== tt

3

0)( Rtt i

n

i

ii ∈=∑

=

aaf

011

00

ppapa−=

=⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡−

=⎥⎦

⎤⎢⎣

1

0

1

0

1101

pp

aa

⎥⎦

⎤⎢⎣

⎡=

1

0

pp

B

From control points p, we can solve coefficients a

Page 21: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

More control points

p0

p1

p2

Page 22: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

More control points

p0

p1 2210)( ttt aaaf ++=

p2

22

100 00)0( aaafp ++==

22

101 5.05.0)5.0( aaafp ++==

22

102 11)0.1( aaafp ++==⎥⎥⎥

⎢⎢⎢

⎥⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

2

1

0

2

1

0

11125.05.01001

aaa

ppp

⎥⎥⎥

⎢⎢⎢

⎡=

2

1

0

aaa

C

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥

⎢⎢⎢

−−−=

⎥⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

⎡−

2

1

0

2

1

01

2

1

0

242143

001

ppp

ppp

Caaa [ ]

⎥⎥⎥

⎢⎢⎢

⎡=

2

1

021)(

aaa

f ttt

⎥⎥⎥

⎢⎢⎢

⎡= −

2

1

01

ppp

tC⎥⎥⎥

⎢⎢⎢

⎡=

2

1

0

ppp

tBBy solving a matrix equation that satisfies the constraints,we can get polynomial coefficients

Page 23: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Two views on polynomial curves 

[ ]⎥⎥⎥

⎢⎢⎢

⎡=

2

1

021)(

ppp

Bf ttt

[ ] )(1)(

2

1

02

⎥⎥⎥

⎢⎢⎢

⎡=

ppp

Bf ttt

2210)( ttt aaaf ++=

[ ]⎥⎥⎥

⎢⎢⎢

⎡=

2

1

02 )1()(

ppp

Bf ttt

221100 )()()()( pppf tbtbtbt ++=

From control points p, we can compute coefficients a

Each point on the curve is a linear blending of the control points

[ ]⎥⎥⎥

⎢⎢⎢

⎡=

2

1

0

210 )()()(ppp

tbtbtb

Page 24: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

What are b0(t), b1(t), …?

[ ]( ) ⎥⎦

⎤⎢⎣

⎡=

1

01)(pp

Bf tt

1100 )()()( ppf tbtbt +=

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡−

=⎥⎦

⎤⎢⎣

1

0

1

0

1101

pp

aa

Two control point case:

[ ] [ ] ⎥⎦

⎤⎢⎣

⎡−

=1101

1)()( 10 ttbtb

[ ]tt−= 1

b0(t) b1(t)

Page 25: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

What are b0, b1, …?

[ ]⎥⎥⎥

⎢⎢⎢

⎡=

2

1

02 )1()(

ppp

Bf ttt

221100 )()()()( pppf tbtbtbt ++=

Three control point case:

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥

⎢⎢⎢

−−−=

⎥⎥⎥

⎢⎢⎢

2

1

0

2

1

0

242143

001

ppp

aaa

[ ] [ ]⎥⎥⎥

⎢⎢⎢

−−−=242143

0011)()()( 2

210 tttbtbtb

[ ]222 244231 tttttt +−−+−= ?)()()( 210 =++ tbtbtb 1≡Which is b0(t)?

Page 26: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

What are b0, b1, …?

• Why                                   is important?– Translation‐invariant interpolation  

[ ]⎥⎥⎥

⎢⎢⎢

⎡=

2

1

02 )1()(

ppp

Bf ttt

221100 )()()()( pppf tbtbtbt ++=

Three control point case:

1)()()( 210 ≡++ tbtbtb

⎥⎥⎥

⎢⎢⎢

+++

⇒⎥⎥⎥

⎢⎢⎢

dpdpdp

ppp

2

1

0

2

1

0 ))(())(())(()( 221100 dpdpdpf +++++= tbtbtbtnew

( )dppp

)()()()()()(

210

221100

tbtbtbtbtbtb

+++++=

df += )(t for any t

Page 27: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Many control points

p0

p1

p2pn

002

020100 )( paaaaf =++++= nntttt L

3

0)( Rtt i

n

i

ii ∈=∑

=

aaf

112

121101)( paaaaf =++++= nntttt L

L

nn

nnnnn tttt paaaaf =++++= L2

210)(⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢

nnnnn

n

n

tt

tttt

p

pp

a

aa

MM

L

L

L

L

1

0

1

0

11

00

1

11

Straightforward, but not intuitive

Page 28: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Many control points

• A shortcut

• Goal:

• Idea:

• Magic: 

∑=

=n

iii tbt

0)()( pf

iit pf =)(

ijtbtb

ji

ii

≠==

0)(1)(

∏≠= −

−=

n

ijj ji

ji tt

tttb

,0

)(

ni

n

ii

i

ii

i

ii

i

ii tttt

tttt

tttt

tttt

tttt

tttt

−−

−−

−−

−−

−−

−−

=+

+

− LL1

1

1

1

1

1

0

0

Getting bi(t) is easier!

∑=

=n

ii tb

0?)( 1≡ Why?

?)(0

=∑=

n

iji tb nj L,1,0,1 =∀=

is a polynomial of degree n∑

=

=n

ii tbtB

0)()(

Lagrange Interpolation

If an n‐degree polynomial has the same value at n+1 locations, it must be a constant polynomial

Page 29: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Lagrange Polynomial Interpolation

Page 30: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Lagrange Interpolation Demo

• http://www.math.ucla.edu/~baker/java/hoefer/Lagrange.htm

• Properties:– The curve passes through all the control points

– Very smooth: Cn for n control points

– Do not have local control

– Overshooting

Page 31: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Piecewise Cubic Polynomials

• Desired Features:– Interpolation

– Local control 

– C1 or C2

33

2210)( tttt aaaaf +++=

Page 32: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Natural Cubics

33

22

100 000)0( aaaafp +++==

32

211 0302)0( aaafp ⋅+⋅+=′=

322 062)0( aafp ⋅++=′′=

33

2210)( tttt aaaaf +++=

32103 )1( aaaafp +++==

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

3

2

1

0

3

2

1

0

1111020000100001

aaaa

pppp

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

−−−

=

⎥⎥⎥⎥

⎢⎢⎢⎢

3

2

1

0

3

2

1

0

15.01105.00000100001

pppp

aaaa

Page 33: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Natural Cubics

• If we have n points, how to use natural cubic to interpolate them? – Define the first and second derivatives for the starting point of the first segment. 

– Compute the cubic for the first segment

– Copy the first and second derivatives for the end point of the first segment to the starting point for the second segment

• How many segments do we have for n control points? • n‐1

Page 34: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Natutral Cubic Curves

• Demo: http://www.cse.unsw.edu.au/~lambert/splines/ 

Page 35: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Natural CubicsInterpolate control points

Has local control C2 continuity

Natural cubics

Page 36: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Hermit Cubics

33

22

100 000)0( aaaafp +++==

32

211 0302)0( aaafp ⋅+⋅+=′=

3213 32)1( aaafp ++=′=

33

2210)( tttt aaaaf +++=

32102 )1( aaaafp +++==

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

3

2

1

0

3

2

1

0

3210111100100001

aaaa

pppp

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

−−−−

=

⎥⎥⎥⎥

⎢⎢⎢⎢

3

2

1

0

3

2

1

0

12121323

00100001

pppp

aaaa

Page 37: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Hermite Cubic Curves

• If we have n points, how to use Hermite cubic to interpolate them? – For each pair, using the first derivatives at starting and ending points to define the inbetween

• How many segments do we have for n controls? – n/2‐1

Page 38: CS559: Computer Graphics - pages.cs.wisc.edupages.cs.wisc.edu/~lizhang/courses/cs559-2010s/syllabus/03-03-cur… · CS559: Computer Graphics Lecture 13: Hierarchical Modeling and

Hermite CubiesInterpolate control points

Has local control C2 continuity

Natural cubics Yes No Yes

Hermite cubics