SlideShare a Scribd company logo
1 of 41
Animation in Video GamesAnimation in Video Games
presented by
Jason Gregory
jgregory@ea.com
AgendaAgenda
The Goal of Game Animation
Old School Animation
Skeletons and Skins
How Skinning Works (Graphically)
The Math of Skinning
Animation: Bringing a Character to Life
Blending and other Advanced Topics
The Goal of Game AnimationThe Goal of Game Animation
Our goal is simple: To produce realistic
looking animated characters in our games!
Old School AnimationOld School Animation
The very first animated characters were 2D
sprites.
Just like traditional cel animation or flip
books.
Old School Animation (2)Old School Animation (2)
Old School Animation (3)Old School Animation (3)
When we moved to 3D, our first animated
characters were “jointed.”
Each limb or part of a limb is a separate
rigid object.
Problem: Interpenetration at joints!
Old School Animation (4)Old School Animation (4)
Skeletons and SkinsSkeletons and Skins
Modern approach is called “skinning.”
Basic idea:
– Create a jointed skeleton.
– Attach the skin to the skeleton.
– Move skeleton around – skin follows it.
Skin is a 3D model made out of triangles.
Skeleton is invisible – only the skin is seen
by the player.
Skeletons and Skins (2)Skeletons and Skins (2)
Skeletons and Skins (3)Skeletons and Skins (3)
Each vertex of each triangle is attached to
one or more bones.
– We use weights to define bones’ influences.
– Weights at a joint must always add up to 1.
Skeletons and Skins (4)Skeletons and Skins (4)
Skeletons and Skins (5)Skeletons and Skins (5)
 Skeletons have two kinds of poses:
– Bind Pose: The skeleton’s pose when the skin was
first attached.
– Current Pose: Any other pose of the skeleton; usually
a frame of an animation.
 The bind pose is like a “home base” for the
character’s skeleton.
 If you drew the mesh without its skeleton, it would
appear in its bind pose.
Skeletons and Skins (6)Skeletons and Skins (6)
Bind Pose Current Pose
How Skinning WorksHow Skinning Works
Consider a single vertex (v) skinned to the
joint J1. The skeleton is in bind pose:
J1
J0
y
x
v
How Skinning Works (2)How Skinning Works (2)
We want to find the vertex’s new location
(v') in the current pose.
y
x
v'
v
How Skinning Works (3)How Skinning Works (3)
The basic idea is to transform the vertex:
– from model space
– into joint space
The coordinates of the vertex are invariant
in joint space!
– So, we can move the joint around all we want.
When we’re done, we go back to model
space to find the final position (v').
How Skinning Works (4)How Skinning Works (4)
Here’s the original vertex (v), but now in
the joint space of J1:
J1
J0
y
x
v
How Skinning Works (5)How Skinning Works (5)
No matter what pose the skeleton is in, v
and v' are the same when in joint space.
y
x
v'
v
How Skinning Works (6)How Skinning Works (6)
Finally, we go back to model space to find
the final location of the vertex (v').
y
x
v'
v
The Math of SkinningThe Math of Skinning
Let Xi be the translation of joint i.
X0
y
x
X1
v
The Math of Skinning (2)The Math of Skinning (2)
Let Qi be the rotation of joint i.
Q0
y
x
Q1
v
The Math of Skinning (3)The Math of Skinning (3)
We describe the bind pose matrix of joint
J1 as the matrix product of all the
translations and rotations from the root joint
to the joint in question:
∏=
=
j
i
iij
0
QXB
The Math of Skinning (4)The Math of Skinning (4)
Now consider what happens when we move
the skeleton into the current pose:
J1
J0
y
x
v'
The Math of Skinning (5)The Math of Skinning (5)
This time, let Ti be the translation of joint i,
and let Ri be the rotation of joint i:
T0
y
x
T1
R0
R1
v'
The Math of Skinning (6)The Math of Skinning (6)
The matrix describing the current pose is:
which is similar to the bind pose matrix:
∏=
=
j
i
iij
0
RTP
∏=
=
j
i
iij
0
QXB
The Math of Skinning (7)The Math of Skinning (7)
We multiply v by B–1
to get it into joint
space from the bind pose.
Then we multiply that by Pto get it back
into model space, in the current pose.
The Math of Skinning (8)The Math of Skinning (8)
Mathematically, this is:
vBBPPv
vBPv
vBPv
1
0
1
110
0
1
0
1
00
−−
=
−
=
−
==
=′














=′












=′
∏∏
∏∏
ji
i
j
i
i
j
i
i
j
i
i
The Math of Skinning (9)The Math of Skinning (9)
Voila! We can find v' for any pose
imaginable!
y
x
v'
v
The Math of Skinning (10)The Math of Skinning (10)
We do these calculations on each and every
vertex in the model.
Then we draw the final vertices.
For vertices that are affected by more than
one joint, we take a weighted average of
the positions due to each joint.
The Math of Skinning (11)The Math of Skinning (11)
The weighted average for a vertex affected
by joints j and k would be:
1where
1
00
1
00
=+
′+′=′












=′












=′
−
==
−
==
∏∏
∏∏
kj
kkjj
k
i
i
k
i
ik
j
i
i
j
i
ij
ww
ww vvv
vBPv
vBPv
Animation: BringingAnimation: Bringing
Characters to LifeCharacters to Life
 An animation is really just a sequence of poses at
various points in time. The poses are called keys.
 An animation can be described mathematically as:
{ Pj(t) } ∀ j
i.e. a set of pose matrices (keys) for all joints j,
each of which is a function of time t.
 To play back the animation, we extract a pose at
the current time index, skin the model to that pose,
and then draw the model.
Bringing Characters to Life (2)Bringing Characters to Life (2)
Run Weasel, run!
Bringing Characters to Life (3)Bringing Characters to Life (3)
In a simple animation system, the keys are
equally spaced in time.
If we further restrict ourselves to integer
time indices, then extracting a pose amounts
to selecting the appropriate key.
Joint 1:
Joint 2:
Joint 3:
time 0 1 2 3 4 … time = t … N–1
Bringing Characters to Life (3)Bringing Characters to Life (3)
 To reduce memory overhead, the keys can be
compressed, and might not be uniformly spaced.
 We will want to allow the time index to be a real
number (i.e. floating-point).
 So, extracting a pose now requires interpolation
between adjacent key frames.
Joint 1:
Joint 2:
Joint 3:
time 0 1 2 3 4 … time = t … N–1
Interpolation and BlendingInterpolation and Blending
To interpolate positions, we use simple
vector linear interpolation (LERP).
( )
( )
( )
( ) zzz
yyy
xxx
rrr
rrr
rrr
ei
21
21
21
21
1
1
1
..
1
ββ
ββ
ββ
ββ
+−=
+−=
+−=
+−= rrr
Interpolation and Blending (2)Interpolation and Blending (2)
To interpolate rotations, we must use
quaternions. (It is next to impossible to
interpolate matrices.)
We have two choices when interpolating
quats:
– Linear interpolation (LERP)
– Spherical linear interpolation (SLERP)
Interpolation and Blending (3)Interpolation and Blending (3)
 A quaternion LERP is identical to a vector LERP,
but with 4 components.
 SLERP is like a LERP, but the weights are no
longer (1-β) and β. Instead they are:
( )( ) ( )
2211
21
1
21
sin1sin
sin
coscos
rrr
rr
ww
s
w
s
w
s
cc
+=
=
−
=
=
=∴⋅== −
βθθβ
θ
θθ
Interpolation and Blending (4)Interpolation and Blending (4)
 LERP and SLERP can be used to interpolate
between adjacent key frames for a specific time t.
 Interpolation can also be used to blend two
entirely different animations together!
 For example, instead of a character being able to
walk or run, he can do anything in between!
 The blend factor controls how much walk and
how much run we see.
β=0: full walk β=1: full run
β=0.5: half walk, half run
The Animation PipelineThe Animation Pipeline
Typical animation pipeline:
– Pose extraction at current time t
– Pose blending
– Matrix palette generation
– Palette-driven rendering
The matrix palette maps directly to modern
vertex shader architectures (a.k.a. indexed
skinning).
Advanced TopicsAdvanced Topics
Key frame compression techniques
Representing animations as spline curves
instead of interpolated key frames
Action state machines
Skeletal partitioning
Rag-doll physics
…
Q&AQ&A
Thanks for your attention!
Questions can also be sent to:
Jason Gregory
Electronic Arts Los Angeles
jgregory@ea.com

More Related Content

Similar to Animation in video games

Longest common subsequence(dynamic programming).
Longest common subsequence(dynamic programming).Longest common subsequence(dynamic programming).
Longest common subsequence(dynamic programming).munawerzareef
 
Journey to structure from motion
Journey to structure from motionJourney to structure from motion
Journey to structure from motionJa-Keoung Koo
 
Stereo 3D Simulation of Rigid Body Inertia Ellipsoid for The Purpose of Unman...
Stereo 3D Simulation of Rigid Body Inertia Ellipsoid for The Purpose of Unman...Stereo 3D Simulation of Rigid Body Inertia Ellipsoid for The Purpose of Unman...
Stereo 3D Simulation of Rigid Body Inertia Ellipsoid for The Purpose of Unman...inventionjournals
 
Machine learning (7)
Machine learning (7)Machine learning (7)
Machine learning (7)NYversity
 
Cs229 notes7a
Cs229 notes7aCs229 notes7a
Cs229 notes7aVuTran231
 
7600088.ppt
7600088.ppt7600088.ppt
7600088.pptMUST
 
Graphs of the Sine and Cosine Functions Lecture
Graphs of the Sine and Cosine Functions LectureGraphs of the Sine and Cosine Functions Lecture
Graphs of the Sine and Cosine Functions LectureFroyd Wess
 
Open GL 04 linealgos
Open GL 04 linealgosOpen GL 04 linealgos
Open GL 04 linealgosRoziq Bahtiar
 
Arts revealed in calculus and its extension
Arts revealed in calculus and its extensionArts revealed in calculus and its extension
Arts revealed in calculus and its extensionPremier Publishers
 
Depth estimation from stereo image pairs using block-matching
Depth estimation from stereo image pairs using block-matchingDepth estimation from stereo image pairs using block-matching
Depth estimation from stereo image pairs using block-matchingAbhranil Das
 
7.curves Further Mathematics Zimbabwe Zimsec Cambridge
7.curves   Further Mathematics Zimbabwe Zimsec Cambridge7.curves   Further Mathematics Zimbabwe Zimsec Cambridge
7.curves Further Mathematics Zimbabwe Zimsec Cambridgealproelearning
 
NN_02_Threshold_Logic_Units.pdf
NN_02_Threshold_Logic_Units.pdfNN_02_Threshold_Logic_Units.pdf
NN_02_Threshold_Logic_Units.pdfchiron1988
 
Chapter 1: Linear Regression
Chapter 1: Linear RegressionChapter 1: Linear Regression
Chapter 1: Linear RegressionAkmelSyed
 
7-asystem-of-practicles-and-rotational-motion (1).ppt
7-asystem-of-practicles-and-rotational-motion (1).ppt7-asystem-of-practicles-and-rotational-motion (1).ppt
7-asystem-of-practicles-and-rotational-motion (1).pptUdayaAruna1
 
Rotation in 3d Space: Euler Angles, Quaternions, Marix Descriptions
Rotation in 3d Space: Euler Angles, Quaternions, Marix DescriptionsRotation in 3d Space: Euler Angles, Quaternions, Marix Descriptions
Rotation in 3d Space: Euler Angles, Quaternions, Marix DescriptionsSolo Hermelin
 

Similar to Animation in video games (20)

Longest common subsequence(dynamic programming).
Longest common subsequence(dynamic programming).Longest common subsequence(dynamic programming).
Longest common subsequence(dynamic programming).
 
Journey to structure from motion
Journey to structure from motionJourney to structure from motion
Journey to structure from motion
 
Stereo 3D Simulation of Rigid Body Inertia Ellipsoid for The Purpose of Unman...
Stereo 3D Simulation of Rigid Body Inertia Ellipsoid for The Purpose of Unman...Stereo 3D Simulation of Rigid Body Inertia Ellipsoid for The Purpose of Unman...
Stereo 3D Simulation of Rigid Body Inertia Ellipsoid for The Purpose of Unman...
 
Machine learning (7)
Machine learning (7)Machine learning (7)
Machine learning (7)
 
Cs229 notes7a
Cs229 notes7aCs229 notes7a
Cs229 notes7a
 
7600088.ppt
7600088.ppt7600088.ppt
7600088.ppt
 
Introduction to Evolutionary Computations. Akira Imada
Introduction to Evolutionary Computations. Akira ImadaIntroduction to Evolutionary Computations. Akira Imada
Introduction to Evolutionary Computations. Akira Imada
 
Taylor problem
Taylor problemTaylor problem
Taylor problem
 
Graphs of the Sine and Cosine Functions Lecture
Graphs of the Sine and Cosine Functions LectureGraphs of the Sine and Cosine Functions Lecture
Graphs of the Sine and Cosine Functions Lecture
 
Open GL 04 linealgos
Open GL 04 linealgosOpen GL 04 linealgos
Open GL 04 linealgos
 
Arts revealed in calculus and its extension
Arts revealed in calculus and its extensionArts revealed in calculus and its extension
Arts revealed in calculus and its extension
 
Depth estimation from stereo image pairs using block-matching
Depth estimation from stereo image pairs using block-matchingDepth estimation from stereo image pairs using block-matching
Depth estimation from stereo image pairs using block-matching
 
v2chap2.pdf
v2chap2.pdfv2chap2.pdf
v2chap2.pdf
 
7.curves Further Mathematics Zimbabwe Zimsec Cambridge
7.curves   Further Mathematics Zimbabwe Zimsec Cambridge7.curves   Further Mathematics Zimbabwe Zimsec Cambridge
7.curves Further Mathematics Zimbabwe Zimsec Cambridge
 
Digtial Image Processing Q@A
Digtial Image Processing Q@ADigtial Image Processing Q@A
Digtial Image Processing Q@A
 
NN_02_Threshold_Logic_Units.pdf
NN_02_Threshold_Logic_Units.pdfNN_02_Threshold_Logic_Units.pdf
NN_02_Threshold_Logic_Units.pdf
 
Chapter 1: Linear Regression
Chapter 1: Linear RegressionChapter 1: Linear Regression
Chapter 1: Linear Regression
 
7-asystem-of-practicles-and-rotational-motion (1).ppt
7-asystem-of-practicles-and-rotational-motion (1).ppt7-asystem-of-practicles-and-rotational-motion (1).ppt
7-asystem-of-practicles-and-rotational-motion (1).ppt
 
Rotation in 3d Space: Euler Angles, Quaternions, Marix Descriptions
Rotation in 3d Space: Euler Angles, Quaternions, Marix DescriptionsRotation in 3d Space: Euler Angles, Quaternions, Marix Descriptions
Rotation in 3d Space: Euler Angles, Quaternions, Marix Descriptions
 
Ch7 angular momentum
Ch7 angular momentumCh7 angular momentum
Ch7 angular momentum
 

Recently uploaded

7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...Paul Menig
 
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxB.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxpriyanshujha201
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...lizamodels9
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayNZSG
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Roland Driesen
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒anilsa9823
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 

Recently uploaded (20)

7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...
 
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxB.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pillsMifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 

Animation in video games

  • 1. Animation in Video GamesAnimation in Video Games presented by Jason Gregory jgregory@ea.com
  • 2. AgendaAgenda The Goal of Game Animation Old School Animation Skeletons and Skins How Skinning Works (Graphically) The Math of Skinning Animation: Bringing a Character to Life Blending and other Advanced Topics
  • 3. The Goal of Game AnimationThe Goal of Game Animation Our goal is simple: To produce realistic looking animated characters in our games!
  • 4. Old School AnimationOld School Animation The very first animated characters were 2D sprites. Just like traditional cel animation or flip books.
  • 5. Old School Animation (2)Old School Animation (2)
  • 6. Old School Animation (3)Old School Animation (3) When we moved to 3D, our first animated characters were “jointed.” Each limb or part of a limb is a separate rigid object. Problem: Interpenetration at joints!
  • 7. Old School Animation (4)Old School Animation (4)
  • 8. Skeletons and SkinsSkeletons and Skins Modern approach is called “skinning.” Basic idea: – Create a jointed skeleton. – Attach the skin to the skeleton. – Move skeleton around – skin follows it. Skin is a 3D model made out of triangles. Skeleton is invisible – only the skin is seen by the player.
  • 9. Skeletons and Skins (2)Skeletons and Skins (2)
  • 10. Skeletons and Skins (3)Skeletons and Skins (3) Each vertex of each triangle is attached to one or more bones. – We use weights to define bones’ influences. – Weights at a joint must always add up to 1.
  • 11. Skeletons and Skins (4)Skeletons and Skins (4)
  • 12. Skeletons and Skins (5)Skeletons and Skins (5)  Skeletons have two kinds of poses: – Bind Pose: The skeleton’s pose when the skin was first attached. – Current Pose: Any other pose of the skeleton; usually a frame of an animation.  The bind pose is like a “home base” for the character’s skeleton.  If you drew the mesh without its skeleton, it would appear in its bind pose.
  • 13. Skeletons and Skins (6)Skeletons and Skins (6) Bind Pose Current Pose
  • 14. How Skinning WorksHow Skinning Works Consider a single vertex (v) skinned to the joint J1. The skeleton is in bind pose: J1 J0 y x v
  • 15. How Skinning Works (2)How Skinning Works (2) We want to find the vertex’s new location (v') in the current pose. y x v' v
  • 16. How Skinning Works (3)How Skinning Works (3) The basic idea is to transform the vertex: – from model space – into joint space The coordinates of the vertex are invariant in joint space! – So, we can move the joint around all we want. When we’re done, we go back to model space to find the final position (v').
  • 17. How Skinning Works (4)How Skinning Works (4) Here’s the original vertex (v), but now in the joint space of J1: J1 J0 y x v
  • 18. How Skinning Works (5)How Skinning Works (5) No matter what pose the skeleton is in, v and v' are the same when in joint space. y x v' v
  • 19. How Skinning Works (6)How Skinning Works (6) Finally, we go back to model space to find the final location of the vertex (v'). y x v' v
  • 20. The Math of SkinningThe Math of Skinning Let Xi be the translation of joint i. X0 y x X1 v
  • 21. The Math of Skinning (2)The Math of Skinning (2) Let Qi be the rotation of joint i. Q0 y x Q1 v
  • 22. The Math of Skinning (3)The Math of Skinning (3) We describe the bind pose matrix of joint J1 as the matrix product of all the translations and rotations from the root joint to the joint in question: ∏= = j i iij 0 QXB
  • 23. The Math of Skinning (4)The Math of Skinning (4) Now consider what happens when we move the skeleton into the current pose: J1 J0 y x v'
  • 24. The Math of Skinning (5)The Math of Skinning (5) This time, let Ti be the translation of joint i, and let Ri be the rotation of joint i: T0 y x T1 R0 R1 v'
  • 25. The Math of Skinning (6)The Math of Skinning (6) The matrix describing the current pose is: which is similar to the bind pose matrix: ∏= = j i iij 0 RTP ∏= = j i iij 0 QXB
  • 26. The Math of Skinning (7)The Math of Skinning (7) We multiply v by B–1 to get it into joint space from the bind pose. Then we multiply that by Pto get it back into model space, in the current pose.
  • 27. The Math of Skinning (8)The Math of Skinning (8) Mathematically, this is: vBBPPv vBPv vBPv 1 0 1 110 0 1 0 1 00 −− = − = − == =′               =′             =′ ∏∏ ∏∏ ji i j i i j i i j i i
  • 28. The Math of Skinning (9)The Math of Skinning (9) Voila! We can find v' for any pose imaginable! y x v' v
  • 29. The Math of Skinning (10)The Math of Skinning (10) We do these calculations on each and every vertex in the model. Then we draw the final vertices. For vertices that are affected by more than one joint, we take a weighted average of the positions due to each joint.
  • 30. The Math of Skinning (11)The Math of Skinning (11) The weighted average for a vertex affected by joints j and k would be: 1where 1 00 1 00 =+ ′+′=′             =′             =′ − == − == ∏∏ ∏∏ kj kkjj k i i k i ik j i i j i ij ww ww vvv vBPv vBPv
  • 31. Animation: BringingAnimation: Bringing Characters to LifeCharacters to Life  An animation is really just a sequence of poses at various points in time. The poses are called keys.  An animation can be described mathematically as: { Pj(t) } ∀ j i.e. a set of pose matrices (keys) for all joints j, each of which is a function of time t.  To play back the animation, we extract a pose at the current time index, skin the model to that pose, and then draw the model.
  • 32. Bringing Characters to Life (2)Bringing Characters to Life (2) Run Weasel, run!
  • 33. Bringing Characters to Life (3)Bringing Characters to Life (3) In a simple animation system, the keys are equally spaced in time. If we further restrict ourselves to integer time indices, then extracting a pose amounts to selecting the appropriate key. Joint 1: Joint 2: Joint 3: time 0 1 2 3 4 … time = t … N–1
  • 34. Bringing Characters to Life (3)Bringing Characters to Life (3)  To reduce memory overhead, the keys can be compressed, and might not be uniformly spaced.  We will want to allow the time index to be a real number (i.e. floating-point).  So, extracting a pose now requires interpolation between adjacent key frames. Joint 1: Joint 2: Joint 3: time 0 1 2 3 4 … time = t … N–1
  • 35. Interpolation and BlendingInterpolation and Blending To interpolate positions, we use simple vector linear interpolation (LERP). ( ) ( ) ( ) ( ) zzz yyy xxx rrr rrr rrr ei 21 21 21 21 1 1 1 .. 1 ββ ββ ββ ββ +−= +−= +−= +−= rrr
  • 36. Interpolation and Blending (2)Interpolation and Blending (2) To interpolate rotations, we must use quaternions. (It is next to impossible to interpolate matrices.) We have two choices when interpolating quats: – Linear interpolation (LERP) – Spherical linear interpolation (SLERP)
  • 37. Interpolation and Blending (3)Interpolation and Blending (3)  A quaternion LERP is identical to a vector LERP, but with 4 components.  SLERP is like a LERP, but the weights are no longer (1-β) and β. Instead they are: ( )( ) ( ) 2211 21 1 21 sin1sin sin coscos rrr rr ww s w s w s cc += = − = = =∴⋅== − βθθβ θ θθ
  • 38. Interpolation and Blending (4)Interpolation and Blending (4)  LERP and SLERP can be used to interpolate between adjacent key frames for a specific time t.  Interpolation can also be used to blend two entirely different animations together!  For example, instead of a character being able to walk or run, he can do anything in between!  The blend factor controls how much walk and how much run we see. β=0: full walk β=1: full run β=0.5: half walk, half run
  • 39. The Animation PipelineThe Animation Pipeline Typical animation pipeline: – Pose extraction at current time t – Pose blending – Matrix palette generation – Palette-driven rendering The matrix palette maps directly to modern vertex shader architectures (a.k.a. indexed skinning).
  • 40. Advanced TopicsAdvanced Topics Key frame compression techniques Representing animations as spline curves instead of interpolated key frames Action state machines Skeletal partitioning Rag-doll physics …
  • 41. Q&AQ&A Thanks for your attention! Questions can also be sent to: Jason Gregory Electronic Arts Los Angeles jgregory@ea.com

Editor's Notes

  1. State goal. Introduce Weasel – describe Crank the Weasel – upcoming Midway game. “But how does it work?” Pretend you’re a game programmer – what will we do to make this happen?
  2. Animation used to be done by rapidly replacing the character’s sprite with successive images from a pre-animated cycle. Could do almost anything this way! Problems: 2D or pseudo-3D only, and memory-intensive.
  3. Describe how jointed anim works
  4. Demonstrate using my own body!