110/27/2015 01:47 graphics ii 91.547 animation introduction and motion control session 6

29
1 06/13/22 16:01 Graphics II 91.547 Animation Introduction and Motion Control Session 6

Upload: jonas-anthony

Post on 03-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

104/20/23 04:53

Graphics II 91.547

AnimationIntroduction and Motion Control

Session 6

Page 2: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

204/20/23 04:53

Animation

0 Traditional 2D animation- Origins in late 1920s- Flat shading- Illusion of 3D produced by fluidity of characters, use of

perspective, motion of “virtual camera”- Disney animators pioneered major techniques

=“Squash and stretch”=Secondary action=Appeal

Page 3: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

304/20/23 04:53

Advantages of Computer Animation

0 Eliminates requirements of building models0 No restriction on camera movement0 Easy inclusion of shading models0 Can introduce physical models

Page 4: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

404/20/23 04:53

Animation Taxonomy

0 Representational animation- Rigid objects

=Single, unchanging model for each object- Articulated objects

=Rigid subobjects, connected at joints=Motions generally revolute

- Soft objects=Model is deformed

0 Procedural animation0 Stochastic animation0 Behavioral animation

Page 5: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

504/20/23 04:53

Motion Control: Keyframing

In computer graphics animation, keyframe -> key parameter. Therefore selection of the parameter becomes critical in defining appropriate motion.

Interpolating angle Interpolating endpoints

Page 6: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

604/20/23 04:53

Motion control of rigid objectsParameterization of position

Rigid Objects

Articulated Objects

Soft Objects

Position

Orientation

Page 7: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

704/20/23 04:53

Spline-driven Position Animation

Q(u)

Equal arc length, s

Equal u

Page 8: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

804/20/23 04:53

Arclength Parameterization of Splines

s A u ( )

Eval. Eval.Spline

su A s 1( )

u

s

Evaluate numerically

(arc length along spline)

Spline parameter

s

x,y,z

Page 9: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

904/20/23 04:53

Arclength Parameterization of Splines

s A u

Q u Q A s

ds dx dy dz

dsdx

du

dy

du

dz

dudu

s udx

du

dy

du

dz

dudu

u

u

( )

( ) ( ( ))

( )

( )

1

2 2 2

2 2 2

2 2 2

0

12

12

12

Arclength along spline:

Q u( )

Q u du( )

z

x

y

dx

dy

dz

Integrating gives:

Page 10: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1004/20/23 04:53

Arclength Parameterization of SplinesQ u au bu cu d

x u a u b u c u d

y u a u b u c u d

z u a u b u c u d

s u Au Bu Cu Du E du

A a a a

B a b a b a b

C a c a c a

x x x x

y y y y

z z z z

u

u

x y x

x x y y z z

x x y y

( )

( )

( )

( )

( ) ( )

( )

( )

(

3 2

3 2

3 2

3 2

4 3

0

2

2 2 2

12

9

12

6 z z x y x

x x y y z z

x y x

c b b b

D b c b c b c

E c c c

) ( )

( )

4

4

2 2 2

2 2 2

General form ofCubic Spline:

Taking the derivativesand integrating:

Where:

This function will not integrate analytically, so integration must bedone numerically.

Page 11: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1104/20/23 04:53

Forward Differencing Approach to Evaluating A

ui

ui1

ui2

ui3

di1

di2

di3

s u s n u d

d Q u Q u

ii

n

i i i

( ) ( )

( ) ( )

1

1

Where:

Q s( )

Page 12: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1204/20/23 04:53

Ease-in, ease-out motionArc length no longer proportional to time

Q(t)

Equal t

Page 13: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1304/20/23 04:53

Velocity Curves

t

s

Velocity Curve

V t u s u( ( ), ( ))

V t u s u

t a u b u c u d

s a u b u c u do

( ( ), ( ))

0

30

20

13

12

1 1

t

u

BisectionSearch

Eval.Cubict

us

Page 14: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1404/20/23 04:53

Velocity Curves

s3

Q u( )

Position Splinet

s

1

2 V t u s u( ( ), ( ))

Velocity Curve

Page 15: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1504/20/23 04:53

Velocity Curves

Q u( )

Position Spline

t

s

Velocity Curve

Equal timeIntervals

GentleAccelerationfrom Rest

Gentle decelerationto Rest

Page 16: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1604/20/23 04:53

General Kinetic Control(Steketee & Badler 1985)

0 “Position Spline”- Let the motion parameter to be interpolated be . is

specified at n key values, . The position spline is constructed by assigning a keyframe number to each key value and interpolating through the resulting tuples:

0 “Kinetic Spline”- Each keyframe number is assigned a time. The kinetic

spline interpolates through the resulting pairs:

0 1 1, ,..., n

( , ),( , ),...,( , ) 0 1 10 1 1n n

( , ), ( , ), ..., ( , )0 1 10 1 1t t n tn

Page 17: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1704/20/23 04:53

Parameterization of Orientation:Euler Angles

x

y

z

x

y

z

x

y

z

1 0 0 0

0 0

0 0

0 0 0 1

1 1

1 1

cos sin

sin cos

Transformation:

cos sin

sin cos

2 2

2 2

0 0

0 1 0 0

0 0

0 0 0 1

cos sin

sin cos

3 3

3 3

0 0

0 0

0 0 1 0

0 0 0 1

Transformation: Transformation:

12

3

Page 18: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1804/20/23 04:53

Multiple Ways to Define Rotation withEuler Angles

cos cos cos sin sin

sin sin cos cos sin sin sin sin cos cos sin cos

cos sin cos sin sin cos sin sin sin cos cos sin

2 3 2 3 2

1 2 3 1 3 1 2 3 1 3 1 2

1 2 3 1 3 1 2 3 1 3 1 2

0

0

0

0 0 0 1

Rx -> Ry -> Rz

Rx -> Rz -> RyRy -> Rx -> RzRy -> Rz -> RxRz -> Rx -> RyRz -> Ry -> Rx

Possible Orderings:

Page 19: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

1904/20/23 04:53

Problems with Euler Angle Parameterization:Gimbal Lock

x

y

z

1

x

y

z

2 2

x

y

z

x’

3 1 now has same effect as

3

Selecting arotation about y removes a degree of freedom.

Page 20: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2004/20/23 04:53

Problems with Euler Angle Parameterization:Interpolation

y

x

z

y

x

z

X roll

Page 21: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2104/20/23 04:53

Problems with Euler Angle Parameterization:Interpolation

y

x

z

y

x

z

y

x

z

Page 22: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2204/20/23 04:53

Problems with Euler Angle Parameterization:Interpolation

R R t R t

R R t t R

( , , ),..., ( , , ),..., ( , , ) [ , ]

( , , ),..., ( , , ),..., ( , , )

0 0 0 0 0 0 0 0 1

0 0 0 0 0

Picture from p. 359

Case 1:

Case 2:

Generating Interpolated Orientations:

Case 1 Case 2

Page 23: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2304/20/23 04:53

Alternate Approach to ParameterizingArbitrary Orientation

R R( , , ) ( , ) 1 2 3 n

Replace Euler angles with a single angle of rotation about

an axial direction defined by the unit vector, n.

r Rr

n

Rr r n(n r) n r (cos ) ( cos ) (sin ) 1

Page 24: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2404/20/23 04:53

Quaternions

i

j

k

A quaternion is made up of a scalarplus a vector:

q a b c d i j k

We use the notation: q s

s a

b c d

q q s s s s

q s

qq q s

( , )

( , )

( , )

v

v i j k

v v v v v v

v

v

where:

1 2 1 2 1 2 1 2 2 1 1 2

2 2 2

Multiplication isdefined:

Page 25: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2504/20/23 04:53

Quaternions

Take a pure quaternion (one that has no scalar part): p ( , )0 r

And a unit quaternion: q (cos ,(sin ) ) n n where: 1

Define: R p qpq qpq qq ( ) 1 (for of unit magnitude)

R p

R p

q

q

( ) ( ,(cos sin ) sin ) cos sin

( ) ( , (cos ) ( cos ) ) (sin ) )

0 2 2

0 2 1 2 2

2 2 2

r n(n r n r

r n(n r n r

(cos , sin ) ( , ) (cos , sin ) ( , ') 2 2 2 20 0n r n r

r n r' ( , )R r

Page 26: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2604/20/23 04:53

Moving in and out of Quaternion Space

q

Z XY WZ XZ WY

XY WZ X Z YZ WX

XZ WY YZ WX X Y

(cos ,(sin ) ) n (W,(X,Y,Z))

1- 2Y2 2 2 2 2 2 0

2 2 1 2 2 2 2 0

2 2 2 2 1 2 2 0

0 0 0 1

2

2 2

2 2

Converts to the transformation matrix:

The quaternion:

M M M

M M M

M M M

00 01 02

10 11 12

20 21 22

0

0

0

0 0 0 1

W

MMZ

W

MMY

W

MMX

MMMW

4

4

4

)1(2

1

0110

2002

1221

21

221100

Page 27: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2704/20/23 04:53

Interpolating Between Two Quaternions

interp( , , )sin( )

sin

sin

sinq q u q

uq

u1 2 1 2

1

q q1 2 cosWhere:

Page 28: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2804/20/23 04:53

Interpolating Examples

Page 29: 110/27/2015 01:47 Graphics II 91.547 Animation Introduction and Motion Control Session 6

2904/20/23 04:53

Interpolating Examples, contd.

Pictures from page 367