animation marco gillies. computer animation making things move a key aspect of computer graphics...

39
Manajemen SDM (Overview) (Overview)

Upload: nathaniel-mcintosh

Post on 28-Mar-2015

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Animation

Marco Gillies

Page 2: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Computer Animation

• “Making things move”

• A key aspect of computer graphics

• Non-realtime for films

• Realtime for virtual worlds and games

Page 3: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Computer Animation

• 2 basic classes of computer animation:

• Keyframe animation– Data driven– Hand animation or performance driven

• Simulation– Procedural/algorithm driven– Particle systems, physics, artificial life

Page 4: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Computer animation

• Keyframe animation relies on data – from animators or actors

• Simulation or procedural animation takes a more algorithmic approach– Animation is directly generated by an

algorithm or calculation

Page 5: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Course Outline

• Traditional animation– Cell animation– Stop Motion

• Computer animation– Trad vs Computer animation– Keyframe– Interpolation

Page 6: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Traditional Animation

Page 7: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Flip Books

• The most basic form of animation is the flip book

• Presents a sequence of images in quick succession

• In film this becomes a sequence of frames

Page 8: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 9: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 10: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 11: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 12: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 13: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 14: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 15: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 16: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 17: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 18: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 19: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 20: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 21: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 22: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 23: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 24: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 25: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 26: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 27: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 28: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 29: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 30: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 31: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 32: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 33: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 34: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 35: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 36: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 37: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 38: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 39: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 40: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 41: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 42: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 43: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 44: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

The Time Line

Lasseter ‘87

Time

• Animation is a sequence of frames (images) arranged along a time-line

Page 45: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Cell Animation

• Cell animation works on the same principle

• Display a sequence of images at 25 frames per second

Page 46: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Frames

• Each frame is an image

• Traditionally each image had to be hand drawn individually

• This potentially requires vast amounts of work from a highly skilled animator

Page 47: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Layers

• Have a background images that don’t move• Put foreground images on a transparent slide in

front of it • Only have to animate bits that move• Next time you watch an animation notice that the

background is always more detailed than the characters

• Asian animation often uses camera pans across static images

Page 48: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Keyframing

• The head animator draws the most important frames (Keyframes)

• An assistant draws the in-between frames (inbetweening)

Lasseter ‘87

Page 49: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Other Techniques

• Squash and stretch• Slow in slow out

Lasseter ‘87

Page 50: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Other Techniques

• Squash and stretch– Change the shape of an object to emphasise its

motion– In particular stretch then squash when changing

direction

Lasseter ‘87

Page 51: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Other Techniques

• Slow in slow out– Control the speed of an animation to make it seem

smoother– Start slow, speed up in the middle and slow to a

stop

Lasseter ‘87

Page 52: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Stop Motion Animation

• Create models of all your characters

• Pose them

• Take a photo

• Move them slightly

• Take another photo

Page 53: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Stop Motion Animation

• More effort on Creating Characters

• A lot of detail

• Each individual movement is less work – (though still a lot)

Page 54: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Exercise (in Processing)

• Load the set of images• doc.gold.ac.uk/~mas02mg/CC2_Animation/animation_frames.zip

• Display one image after the other

Page 55: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Computer animation

Page 56: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Computer Animation

• Computer animation (both 2D and 3D) is quite a lot like Stop Motion Animation

• You put a lot of effort into creating a (Virtual) model of a character

• Then when animating it you move it frame by frame

Page 57: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Computer animation

• You give the character a number of controls by which you move it– Translate, rotate etc.– E.g. skeleton

• This is called rigging

• You put a lot of work on set up

• Animation is simple

Page 58: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Keyframing

• Keyframing can reduce this effort even more

• The animator only needs to define the “key frames” of a movement

• The computer does the in betweening

Page 59: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and
Page 60: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Keyframing

• Keyframes aren’t images

• They are poses of a character

• Keyframes are now settings for value at a given time (a tuple)

>valuetime,• (For now I’ll just talk about animating

position)

Page 61: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Keyframing

Page 62: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Linear Interpolation

Page 63: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Linear Interpolation

• The position is interpolated linearly between keyframes

)t)P(t(+)tP(t=P(t) kk 11

Page 64: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Linear Interpolation

• The position is interpolated linearly between keyframes

)t)P(t(+)tP(t=P(t) kk 11

)P(ttt

tt+)P(t

tt

tt=P(t) k

kk

kk

kk

k1

1

1

1

1 1

Page 65: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Linear Interpolation

• The position is interpolated linearly between keyframes

)t)P(t(+)tP(t=P(t) kk 11

• The animation can be jerky• Need some equivalent of slow-in slow-out

)P(ttt

tt+)P(t

tt

tt=P(t) k

kk

kk

kk

k1

1

1

1

1 1

Page 66: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Linear Interpolation

QuickTime™ and aAnimation decompressor

are needed to see this picture.

Page 67: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Spline Interpolation

• Use smooth curves to interpolate positions

• Use curves similar to Bezier

Page 68: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Spline Interpolation

Page 69: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Bezier Curves

• Smooth but don’t go through all the control points, we need to go through all the keyframes

Page 70: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Hermite Curves

• Rather than specifying 4 control points specify 2 end points and tangents at these end points

• In the case of interpolating positions the tangents are velocities

Page 71: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Hermite Curves

• The maths is pretty much the same as Bezier Curves

• Bezier:

33

22

12

03 13t13t1 Pt+t)P(+Pt)(+Pt)(=P(t)

• Hermite:

P(t) = (2t 3 3t 2 +1)P0 +(t3 2t 2 +t)T0

+( 2t 3 +3t 2 )P1+(t3 t 2 )T1

Page 72: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Hermite Curves

• Transforming between the two• Bezier to Hermite:

P0 = PB0,T0 = 3 PB1 PB 0 ,P1 = PB3 ,T1 = 3 PB3 PB2

• Hermite to Bezier:

PB0 = P0,PB1 =1

3T0 P0 ,PB3 = P1,PB2 = P1

1

3T1

Page 73: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Tangents

• That’s fine, but where do we get the tangents (velocities) from?

• We could directly set them, they act as an extra control on the behaviour

• However often we want to generate them automatically

Page 74: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Tangents

• Base the tangent at a keyframe on the previous and next keyframe

Page 75: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Tangents

• Average the distance from the pervious keyframe and to the next one

Page 76: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Tangents

• Average the distance from the previous keyframe and to the next one

k+kkkk PP+PP=T 11 2

1

2

1

112

1 k+k PP=

• Catmull-Rom Splines

• If you set the tangents at the first and last frame to zero you get slow in slow out

Page 77: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Spline interpolation

QuickTime™ and aAnimation decompressor

are needed to see this picture.

Page 78: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

Exercise (in Processing)

• Write a program:– Click on points on a screen– The time and position are stored as an array

of keyframes– When you hit return the stored movements

are replayed with a dot moving smoothly between the points

Page 79: Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and

• float [] time = new float[20];• int [] xs = new int[20];• int [] ys = new int[20];

• int currentFrame = 0;• float starttTime;

• void draw()• {• if (clock() - startTime > time[currentFrame+1] ){• currentFrame ++;• }• • translate(xs[currentFrame], ys[currentFrame]);• rect( 0, 0, 10,10); • • }