computer animation. animation animate = “to give life to” specify, directly or indirectly, how...

92
Computer Animation

Upload: margaret-short

Post on 13-Dec-2015

242 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Computer Animation

Page 2: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Animation

• Animate = “to give life to”• Specify, directly or indirectly, how ‘thing’ moves

in time and space

Page 3: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Angel Games

Page 4: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Animation Applications• Special Effects (Movies, TV)

• Video Games

• Virtual Reality

• Simulation, Training, Military

• Medical

• Robotics, Animatronics

• Visualization

• Communication

Page 5: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Frame Rates

• Film 24 fps• Imax 48 fps• NTSC TV 30 fps (interlaced)• PAL TV 25 fps (interlaced)• HDTV 60 fps• Computer ~60 fps

Page 6: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Animation

• How do we describe and generate motion of object in the scene?

Page 7: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Animation File FormatsSoftware File FormatDirector .dir & .dcrAnimator Pro .fliStudio Max .maxSuperCard and Director .picsWindows Audio Video Interleaved .aviMacintosh .qt & .movMotion Video .mpegCompuServe .gifFlash .swfShockwave .dcr

Page 8: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Web Page Animation File Formats(1)

• GIF Files–GIF89a’s ability to store a sequence

of images has been used to provide a cheap and cheerful form of small animation for Web page advertisements.

Page 9: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Web Page Animation File Formats(2)

• GIF Shortcomings:

However, even when GIF animation is properly implemented and enabled, it has many shortcomings.

1) Sound can not be added.

2) Colour palette is restricted to 256.

3) Images are losslessly compressed.

Page 10: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

QuickTime

• For animation of any duration, especially if it is accompanied by sound, the best result will be achieved using a video format, and QuickTime has become the standard.

Page 11: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Heritage of Animation

• Persistence of vision: discovered about 1800s– Zoetrope or “wheel of life”– Flip-book

Page 12: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Heritage of Animation

• Camera to make lifeless things move– Meleis 1890 using simple tricks– Emil Cohl (1857-1938, French)

Page 13: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Disney: Animation as an art form

• Innovations– Story board to review story– Pencil sketch to review motion– Multi-plane camera stand– Color (not first to use color)– Sound!

• Steamboat Willie (1928)

Page 14: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Two main categories

• Computer-assisted animation– 2D & 2 1/2 D

– Inbetweening

– Inking, virtual camera, managing data, etc

• Computer generated animation– Low level techniques

• Precisely specifying motion

– High level techniques• Describe general motion behavior

Page 15: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Low level techniques

• Shape interpolation (in-betweening)• Have to know what you want

Page 16: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

High level techniques

• Generate motion with set of rules or constraints– Physically based

motion

http://www.cs.berkeley.edu/~job/Projects/SoundGen/video.html

Page 17: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Why animation works

• The eye cannot register images faster than

approximately 60 frames per second

(30 is just about adequate)

• If a gap in the projection occurs, the eye seems to

perform spatial interpolation over the gap

Page 18: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Animation and Frame Rates

• TV video builds 30 entire frames or pictures every second.

• Movies are shot at a shutter rate of 24 frames per second, but using projections tricks the flicker is increased to 48.

• On some projectors each frame is shown 3 times before the next frame, for a total of 72 flickers per second which helps eliminate the flicker effect.

• Cel Animation – plays at 24 frames per second.

Page 19: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Displaying animation sequences• To achieve smooth animation, a sequence of

images (frames) have to be presented on a screen with the speed of at least 30 per second

• Animations frames can be

– pre-computed in advance and pre-loaded in memory

– computed in real time (e.g. movement of the cursor)

Page 20: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Raster animation

• This is the most common animation technique

• Frames are copied very fast from off-screen memory to the frame buffer

• Copying can be applied to

– complete frames

– only parts of the frame which contain some movement

Page 21: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Examples

Step 1 (erase) Step 2 (move) Step 3 (draw)

Ship is redrawn in background colour

Move ship

x’ = x + Dxy’ = y + Dy

(x,y)(x,y) (x+Dx,y+Dy) (x’,y’)

Page 22: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 23: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Double buffering

• Used to achieve smooth animation

• The next frame of animation is computed to an off-screen buffer at the same time when the current frame is transferred to the frame buffer.

Load to theframe buffer

CreateFrame

Load to theframe buffer

CreateFrame

Load to theframe buffer

CreateFrame

Time

Page 24: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

2-D Animation

Two types:

Cel animationPath animation

Page 25: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Cel Animation• Made famous by Disney• 24 frames per second therefore a

minute may require as many as 1,440 separate frames.

• It is based on changes that occur from one frame to the next.

• Cel stands for celluloid which is a clear sheet with images drawn on them.

• The celluloid images are place on a background that is usually stationary.

• The background remain fixed as the images changes.

Page 26: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Cel Animation

• Those elements in a scene that might move are drawn on sheets of transparent material known as ‘cel’, and laid over a background drawn separately.

Page 27: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Path Animation• Moves an object along a predetermined path

on the screen• The path can be a straight line or have a

number of curves.• Starts with keyframes (the first and last frame

of an action). • The series of frames in between the keyframes

are drawn in a process called tweening. • Tweening requires calculating the number of

frames between keyframes and the path the action takes, and then actually takes, and then sketches a series of progressively different outlines.

Page 28: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

3-D Animation• 3-D Animation involves three steps:

modeling, animation, and renderingModeling – the process of creating objects and scenesAnimation – the process of defining the object’s motionRendering – the final step in creating 3-D animation.

• Morphing is the process of blending two images into a series of images

• Warping allows you to distort a single image• Virtual reality (VR) creates an environment

that surrounds the user so that they become part of the experience.

Page 29: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Hybrid Forms of Animation

• Mixing cel and 3-D• Combining animation with live footage such as

Jurassic Park.• Add time -> 4D

Page 30: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Steps of a simple computer animation

1. Creating animation sequences

– object definition

– path specification (for an object or a camera)

– key frames

– in-betweening

2. Displaying the sequences

– raster animation

– colour-table animation

Page 31: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Object definition

• In simple manual systems, the objects can be simply the artist drawings

• In computer-generated animations, models are used

• Examples of models:

– a "flying logo" in a TV advert

– a walking stick-man

– a dinosaur attacking its prey in Jurassic Park

Page 32: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Character Development

• 300 Drawings

Page 33: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Character Development

• 40 Sculptures

Page 34: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Character Development• Computer

Models

Page 35: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Storyboarding

• Explicitly define– Scenes– Camera shots– Special effects– Lighting– Scale

• Used as guide by animators

Page 36: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Layout and Look

• Build scenery• Match colors

Page 37: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Path specification

• Impression of movement can be created for two basic situations, or for their combination:

– static object, moving camera

– static camera, moving object

• The path defines the sequence of locations (for either the camera or the object) for the consecutive time frames

Page 38: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Static object, moving camera

F3

F1

F2F4

Time

F5

Page 39: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Static camera, moving object

F1 F2 F3 F4

Page 40: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

It is important to remember that when the

object moves along the path, not only its

position changes, but also its orientation

X

Y

Z

X

Y

Z

Page 41: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Keyframing

Describe motion of objects as a function of time from a set of key object positions. In short, compute the inbetween frames.

ACM © 1987 “Principles of traditional animation applied to 3D computer animation”

( )s t

Page 42: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 43: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 44: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 45: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 46: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 47: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Keyframe Animation• Set target positions for vertices at “key” frames in

animations

• Linearly interpolate vertex positions between targets at intervening frames

• Lots can go wrong (like the feet)

• Can be fixed by adding key frames

• Piecewise linear approach to animation

• Need same number and configuration of vertices at key frames for intervening frames to make sense

• Often need to find correspondences between two collections of vertices

Page 48: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Keyframe Animation• Set target positions for vertices at “key”

frames in animations

• Linearly interpolate vertex positions between targets at intervening frames

• Lots can go wrong (like the feet)

• Can be fixed by adding key frames

• Piecewise linear approach to animation

• Need same number and configuration of vertices at key frames for intervening frames to make sense

• Often need to find correspondences between two collections of vertices

Page 49: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Key frames

• Compute first a small number of key frames• Interpolate the remaining frames in-between

these key frames (in-betweening)

• Key frames can be computed– at equal time intervals– according to some other rules– for example when the direction of the path changes

rapidly

Page 50: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

In-betweening

• The simplest method of in-betweening is linear interpolation

• Interpolation is normally applied to the projected object points

Page 51: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

1

2

Key frame k

1’

2’

Key frame k+1

33’

added point

Halfway frame

Page 52: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

In-betweening - example

• Given coordinates of a 2D point– key frame n: (xn,yn)

– key frame n+1: (xn+1,yn+1)

– time interval between the two key frames: 1/10 second

• To get smooth animation, needs at least 30 frames per second

• Solution: insert at least further 2 frames between the given two key frames

Page 53: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 54: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Keyframes and In-Betweening

Before AfterIn-betweens

Page 55: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Calculating in-between frames using linear interpolation

x = (xn+1 - xn) / 3

y = (yn+1 - yn) / 3

for ( i=1; i<3; i++ )

{

xi = xn + i * x

yi = yn + i * y

}

Page 56: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Example: Interpolating Positions

• Given positions:

• find curve such that

( , , ), 0, ,i i ix y t i n

( )( )

( )

x tt

y tC

( ) i

ii

xt

yC

0u0 0 0( , , )x y t

1 1 1( , , )x y t

2 2 2( , , )x y t

( )tC

Page 57: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Linear Interpolation

• Simple problem: linear interpolation between first two points assuming :

• The x-coordinate for the complete curve in the figure:

0 0 0( , , )x y t

1 1 1( , , )x y t

2 2 2( , , )x y t

0 1=0 and =1t t

0 1( ) 1x t x t x t

Page 58: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Linear Interpolation

• Two Problems with Linear Interpolation–Unnatural movement

• Nothing really moves like this – motion begins and ends instantaneously, with objects attaining their full velocity as soon as they start to move, and maintaining it until they stop.

• Solution: using hand-made animation

Page 59: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Polynomial Interpolation

• An n-degree polynomial can interpolate any n+1 points. The Lagrange formula gives the n+1 coefficients of an n-degree polynomial that interpolates n+1 points. The resulting

interpolating polynomials are called Lagrange polynomials.

0 0 0( , , )x y t

1 1 1( , , )x y t

2 2 2( , , )x y t

parabola

Page 60: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Easing In

• The object accelerate from a standstill to its final velocity.

Page 61: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

(Hodkins, http://www.cc.gatech.edu/classes/cs8113a_98_spring/principles.pdf)

Page 62: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

(Hodkins, http://www.cc.gatech.edu/classes/cs8113a_98_spring/principles.pdf)

Page 63: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Rigid body animation

• Rigid body animation uses standard 3D transformations

• At least 30 frames per second to achieve smooth animation

• Computing each frame would take too long

Page 64: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

(Hodkins, http://www.cc.gatech.edu/classes/cs8113a_98_spring/principles.pdf)

Page 65: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Robotic Arm Example

• Fingers first• Then wrist• Then elbow• Finally,

shoulder

Page 66: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

T1

R1

R2

R3

P

Find the new location of P (P’) after some translations T1, T2, T3, T4 and rotations R1, R2, and

R3.

Express in terms of a matrix product, i.e.P’ = R1R2R3P

T2

T3

T4

Robotic Arm Example

Page 67: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

PT4

Robotic Arm Example

P’

P’ = T4P

Page 68: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

Robotic Arm Example

P’

P’’ = R3P’ = R3T4P

P’’

R3

Page 69: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

Robotic Arm Example

P’’’ = T3P’’ = T3R3T4P

P’’

T3

P’’’

Page 70: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

Robotic Arm Example

P4 = R2P’’’ = R2T3R3T4PP’’’

P4

R2

Page 71: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

Robotic Arm Example

P4

T2

P5

P5 = T2P4 = T2R2T3R3T4P

Page 72: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

Robotic Arm Example

P5

P6

R1

P6 = R1P5 = R1T2R2T3R3T4P

Page 73: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

Robotic Arm Example

P6

P7

T1

P7 = T1P6 = T1R1T2R2T3R3T4P

Page 74: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

Robotic Arm Example

P6

P7

T1

P7 = T1P6 = T1R1T2R2T3R3T4P

T1

R1

R2

R3

T2T3

T4

Page 75: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

x

y

Robotic Arm Example

P7 = T1P6 = T1R1T2R2T3R3T4P

P7

T1

R1

R2

R3

T2

T3

T4

Page 76: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

3D Transforms

x

y

x’

y’

Tx

y

x’

y’zz’

T

Pretty much exactly the same as 2D transforms

Page 77: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Physically Based Animation

• Assign physical properties to objects (masses, forces, inertial properties)

• Simulate physics by solving equations• Realistic but difficult to control

v0

m g

Page 78: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 79: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 80: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 81: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 82: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 83: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 84: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

84

Topics in Animation

• Scripted Animation– Keyframe interpolation, articulated models,

inverse kinematics, deformations, …

• Procedural Animation– Particle Systems, Flocks, Crowds, Cloth, Fire,

Smoke, Water, …

• Motion capture– Filtering, editing, retargeting, stitching,…

Page 85: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Procedural animation

• describes the motion algorithmically• express animation as a function of small number of

parameters• Example: a clock with second, minute and hour hands

– hands should rotate together– express the clock motions in terms of a “seconds” variable– the clock is animated by varying the seconds parameter

Page 86: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

86

Procedural animation

Page 87: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

87

Scripted Animation

Page 88: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

88

Motion capture

Page 89: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

Motion Capture

• Usually uses optical markers and multiple high-speed cameras

• Triangulate to get marker 3D position• Faces or joints• You must observe someone do something

Page 90: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space

(Hodkins, http://www.cc.gatech.edu/classes/cs8113a_98_spring/)

Page 91: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space
Page 92: Computer Animation. Animation Animate = “to give life to” Specify, directly or indirectly, how ‘thing’ moves in time and space