computer animation. animation animate = “to give life to” specify, directly or indirectly, how...
TRANSCRIPT
Computer Animation
Animation
• Animate = “to give life to”• Specify, directly or indirectly, how ‘thing’ moves
in time and space
Angel Games
Animation Applications• Special Effects (Movies, TV)
• Video Games
• Virtual Reality
• Simulation, Training, Military
• Medical
• Robotics, Animatronics
• Visualization
• Communication
Frame Rates
• Film 24 fps• Imax 48 fps• NTSC TV 30 fps (interlaced)• PAL TV 25 fps (interlaced)• HDTV 60 fps• Computer ~60 fps
Animation
• How do we describe and generate motion of object in the scene?
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
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.
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.
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.
Heritage of Animation
• Persistence of vision: discovered about 1800s– Zoetrope or “wheel of life”– Flip-book
Heritage of Animation
• Camera to make lifeless things move– Meleis 1890 using simple tricks– Emil Cohl (1857-1938, French)
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)
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
Low level techniques
• Shape interpolation (in-betweening)• Have to know what you want
High level techniques
• Generate motion with set of rules or constraints– Physically based
motion
http://www.cs.berkeley.edu/~job/Projects/SoundGen/video.html
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
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.
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)
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
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’)
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
2-D Animation
Two types:
Cel animationPath animation
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.
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.
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.
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.
Hybrid Forms of Animation
• Mixing cel and 3-D• Combining animation with live footage such as
Jurassic Park.• Add time -> 4D
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
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
Character Development
• 300 Drawings
Character Development
• 40 Sculptures
Character Development• Computer
Models
Storyboarding
• Explicitly define– Scenes– Camera shots– Special effects– Lighting– Scale
• Used as guide by animators
Layout and Look
• Build scenery• Match colors
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
Static object, moving camera
F3
F1
F2F4
Time
F5
Static camera, moving object
F1 F2 F3 F4
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
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
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
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
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
In-betweening
• The simplest method of in-betweening is linear interpolation
• Interpolation is normally applied to the projected object points
1
2
Key frame k
1’
2’
Key frame k+1
33’
added point
Halfway frame
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
Keyframes and In-Betweening
Before AfterIn-betweens
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
}
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
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
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
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
Easing In
• The object accelerate from a standstill to its final velocity.
(Hodkins, http://www.cc.gatech.edu/classes/cs8113a_98_spring/principles.pdf)
(Hodkins, http://www.cc.gatech.edu/classes/cs8113a_98_spring/principles.pdf)
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
(Hodkins, http://www.cc.gatech.edu/classes/cs8113a_98_spring/principles.pdf)
Robotic Arm Example
• Fingers first• Then wrist• Then elbow• Finally,
shoulder
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
x
y
PT4
Robotic Arm Example
P’
P’ = T4P
x
y
Robotic Arm Example
P’
P’’ = R3P’ = R3T4P
P’’
R3
x
y
Robotic Arm Example
P’’’ = T3P’’ = T3R3T4P
P’’
T3
P’’’
x
y
Robotic Arm Example
P4 = R2P’’’ = R2T3R3T4PP’’’
P4
R2
x
y
Robotic Arm Example
P4
T2
P5
P5 = T2P4 = T2R2T3R3T4P
x
y
Robotic Arm Example
P5
P6
R1
P6 = R1P5 = R1T2R2T3R3T4P
x
y
Robotic Arm Example
P6
P7
T1
P7 = T1P6 = T1R1T2R2T3R3T4P
x
y
Robotic Arm Example
P6
P7
T1
P7 = T1P6 = T1R1T2R2T3R3T4P
T1
R1
R2
R3
T2T3
T4
x
y
Robotic Arm Example
P7 = T1P6 = T1R1T2R2T3R3T4P
P7
T1
R1
R2
R3
T2
T3
T4
3D Transforms
x
y
x’
y’
Tx
y
x’
y’zz’
T
Pretty much exactly the same as 2D transforms
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
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,…
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
86
Procedural animation
87
Scripted Animation
88
Motion capture
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
(Hodkins, http://www.cc.gatech.edu/classes/cs8113a_98_spring/)