1
Animation & Physically-Based Simulation 0368-3236, Spring 2019 - - PowerPoint PPT Presentation
Animation & Physically-Based Simulation 0368-3236, Spring 2019 - - PowerPoint PPT Presentation
Animation & Physically-Based Simulation 0368-3236, Spring 2019 Tel-Aviv University Amit Bermano 1 Computer Animation Describing how 3D objects (& cameras) move over time Pixar 2 Computer Animation Challenge is balancing
2
Computer Animation
- Describing how 3D objects (& cameras)
move over time
Pixar
3
Computer Animation
- Challenge is balancing between …
- Animator control
- Physical realism
4
Computer Animation
- Manipulation
- Posing
- Configuration control
- Interpolation
- Animation
- In-betweening
focus.gscept.com https://blenderartists.org/
5
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
- Procedural
focus.gscept.com https://blenderartists.org/
6
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
- Procedural
focus.gscept.com https://blenderartists.org/
7
Deformation
- How to change a character’s pose?
- Every vertex directly
- Intuitive computation
https://www.youtube.com/watch?v=oxkf_N-QCNI
8
Deformation
- A HUGE variety of methods
- Laplacian mesh editing
- ARAP
- CAGE Base
- Barycentric coordinates
- Heat diffusion
- Variational
- …
9
Deformation
- A HUGE variety of methods
- Laplacian mesh editing
- ARAP
- CAGE Base
- Barycentric coordinates
- Heat diffusion
- Variational
- …
10
Laplacian Mesh Editing
- Local detail representation – enables detail preservation
through various modeling tasks
- Representation with sparse matrices
- Efficient linear surface
reconstruction
11
Overall framework
- 1. Compute differential representation
- 2. Pose modeling constraints
- 3. Reconstruct the surface – in least-squares sense
𝜀𝑗 = 𝑀 𝑤𝑗 = 𝑤𝑗 − 1 𝑒𝑗 Σ𝑘∈N 𝑗 𝑤𝑘 𝑤𝑗
′ = 𝑣𝑗,
𝑗 ∈ 𝑫 𝑀 𝑀𝑑 𝑾 = 𝜺 𝑽
12
Differential coordinates?
- In matricial form:
- They represent the local detail / local shape description
- The direction approximates the normal
- The size approximates the mean curvature
𝑀𝑗𝑘 = ൞ −𝑥𝑗𝑘 𝑗 ≠ 𝑘 Σ𝑘∈1𝑠𝑗𝑜𝑗𝑥𝑗𝑘 𝑗 = 𝑘 𝑓𝑚𝑡𝑓
13
- In matricial form:
𝑀𝑗𝑘 = ൞ −𝑥𝑗𝑘 𝑗 ≠ 𝑘 Σ𝑘∈1𝑠𝑗𝑜𝑗𝑥𝑗𝑘 𝑗 = 𝑘 𝑓𝑚𝑡𝑓
P Q
Adding constraints
14
Adding constraints
- In matricial form:
𝑀𝑗𝑘 = ൞ −𝑥𝑗𝑘 𝑗 ≠ 𝑘 Σ𝑘∈1𝑠𝑗𝑜𝑗𝑥𝑗𝑘 𝑗 = 𝑘 𝑓𝑚𝑡𝑓
𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7 𝑦8 𝑦9 𝑦10
=
𝜀1 𝜀2 𝜀3 𝜀4 𝜀5 𝜀6 𝜀7 𝜀8 𝜀9 𝜀10 𝑸𝒚 𝑹𝒚
𝑧1 𝑧2 𝑧3 𝑧4 𝑧5 𝑧6 𝑧7 𝑧8 𝑧9 𝑧10
=
𝜀1 𝜀2 𝜀3 𝜀4 𝜀5 𝜀6 𝜀7 𝜀8 𝜀9 𝜀10 𝑸𝒛 𝑹𝒛
P Q
15
Demo
16
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
- Procedural
focus.gscept.com https://blenderartists.org/
17
Blendshapes
- Blendshapes are an approximate semantic parameterization
- Linear blend of predefined poses
18
Blendshapes
https://www.youtube.com/watch?v=KPDfMpuK2fQ
19
Blendshapes
- Usually used for difficult to pose complex deformations
- Such as faces
- Given:
- A mesh 𝑁 = (𝑊, 𝐹) with 𝑛 vertices
- 𝑜 configurations of the same
mesh, 𝑁𝑐 = 𝑊
𝑐, 𝐹 , 𝑐 = 1 … 𝑜
- A new configuration is simply:
- 𝑁′ = (Σ𝑐=1…𝑜wbVb, E)
- Delta formulation:
- 𝑁′ = Σ𝑐=1…𝑜𝑊
0 + wb(Vb − V0 , E)
- A bit more convenient
- 𝑁0 - the rest pose, 𝑥𝑐 blend weights
20
Blendshapes
https://www.youtube.com/watch?v=jBOEzXYMugE
21
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
- Procedural
focus.gscept.com https://blenderartists.org/
22
Angel Figures 8.8 & 8.9 Base Arm Hand
Scene Graph
Articulated Figures
- Character poses described by set of rigid bodies
connected by “joints”
23
Articulated Figures
- Well-suited for humanoid characters
Rose et al. `96 Root LHip LKnee LAnkle RHip RKnee RAnkle Chest LCollar LShld LElbow LWrist LCollar LShld LElbow LWrist Neck Head
25
Articulated Figures
- Animation focuses on joint angles, or general transformations
Watt & Watt
26
Forward Kinematics
- Describe motion of articulated character
1 2 X = (x,y)
l2 l1
(0,0) “End-Effector”
27
Forward Kinematics
- Animator specifies joint angles: 1 and 2
- Computer finds positions of end-effector: X
1 2 X = (x,y)
l2 l1
(0,0)
29
Example: Walk Cycle
- Articulated figure:
Watt & Watt
30
Example: Walk Cycle
- Hip joint orientation:
Watt & Watt
Keyframes
31
Example: Walk Cycle
- Knee joint orientation:
Watt & Watt
32
Example: Walk Cycle
- Ankle joint orientation:
Watt & Watt
33
Example: walk cycle
Lague: www.youtube.com/watch?v=DuUWxUitJos
34
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
- Procedural
focus.gscept.com https://blenderartists.org/
35
Beyond Skeletons…
- Skinning
creativecrash.com
36
Kinematic Skeletons
- Hierarchy of transformations (“bones”)
- Changes to parent affect
all descendent bones
- So far: bones affect objects in scene
- r parts of a mesh
- Equivalently, each point on a mesh
acted upon by one bone
- Leads to discontinuities when
parts of mesh animated
- Extension: each point on a mesh
acted upon by more than one bone
37
Linear Blend Skinning
- Each vertex of skin potentially influenced by all bones
- Normalized weight vector w(v) gives influence of each bone transform
- When bones move, influenced vertices also move
- Computing a transformation Tv for a skinned vertex
- For each bone
- Compute global bone transformation Tb from transformation hierarchy
- For each vertex
- Take a linear combination of bone transforms
- Apply transformation to vertex in original pose
- Equivalently, transformed vertex position is weighted combination of positions
transformed by bones
B b b v b v
T w T
) (
B b b v b d transforme
v T w v
) (
38
Assigning Weights: “Rigging”
- Painted by hand
- Automatic: function of relative distances to
nearest bones
- Smoothness of skinned surface depends on smoothness of weights!
39
Assigning Weights: “Rigging”
- Painted by hand
- Automatic: function of relative distances to
nearest bones
- Smoothness of skinned surface depends on smoothness of weights!
- Other problems with extreme deformations
- Many solutions
40
Assigning Weights: “Rigging”
- Painted by hand
- Automatic: function of relative distances to
nearest bones
- Smoothness of skinned surface depends on smoothness of weights!
- Other problems with extreme deformations
https://cgl.ethz.ch /publications/pap ers/paperOzt13.p hp
41
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
- Procedural
focus.gscept.com https://blenderartists.org/
42
Keyframe Animation
- Define character poses at specific time steps
called “keyframes”
Lasseter `87
43
Keyframe Animation
- Interpolate variables describing keyframes to determine poses
for character in between
Lasseter `87
44
Keyframe Animation
- Inbetweening:
- Linear interpolation - usually not enough continuity
H&B Figure 16.16 Linear interpolation
45
Keyframe Animation
- Inbetweening:
- Spline interpolation - maybe good enough
H&B Figure 16.11
46
Temporal Enhancement
Start frame End frame
47
Time
1 2 3 4 5
Displacement
Temporal Enhancement
x x x x
Database Interpolation
48
Results – Hand Animated Rig
50
Example: Ball Boy
Fujito, Milliron, Ngan, & Sanocki Princeton University “Ballboy”
51
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
- Procedural
focus.gscept.com https://blenderartists.org/
53
Inverse Kinematics
- What if animator knows position of “end-effector”?
1 2 X = (x,y)
l2 l1
(0,0) “End-Effector”
54
Inverse Kinematics
- Animator specifies end-effector positions: X
- Computer finds joint angles: 1 and 2:
1 2 X = (x,y)
l2 l1
(0,0)
55
Inverse Kinematics
- End-effector postions can be specified by spline curves
1 2 X = (x,y)
l2 l1
(0,0) y x t
56
Inverse Kinematics
- Problem for more complex structures
- System of equations is usually under-constrained
- Multiple solutions
1 2
l2 l1
(0,0) X = (x,y)
l3
3 Three unknowns: 1, 2 , 3 Two equations: x, y
57
Inverse Kinematics
- Solution for more complex structures:
- Find best solution (e.g., minimize energy in motion)
- Non-linear optimization
1 2
l2 l1
(0,0) X = (x,y)
l3
3
58
Kinematics
- Advantages
- Simple to implement
- Complete animator control
- Disadvantages
- Motions may not follow physical laws
- Tedious for animator
Lasseter `87
59
Kinematics
- Advantages
- Simple to implement
- Complete animator control
- Disadvantages
- Motions may not follow physical laws
- Tedious for animator
Lasseter `87
60
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
- Procedural
focus.gscept.com https://blenderartists.org/
61
Motion Capture
- Measure motion of real characters and then
simply “play it back” with kinematics
Captured Motion
62
Motion Capture
- Measure motion of
real characters and then simply “play it back” with kinematics
https://www.youtube.com/watch?v=MVvDw15-3e8
63
Motion Capture
- Could be applied on different parameters
- Skeleton Transformations
- Direct mesh deformation
- Advantage:
- Physical realism
- Challenge:
- Animator control
65
Character Animation Methods
- Modeling (manipulation)
- Deformation
- Blendshape rigging
- Skeleton+Envelope rigging
- Interpolation
- Key-framing
- Kinematics
- Motion Capture
- Energy minimization
- Physical simulation
focus.gscept.com https://blenderartists.org/
66
Animation Techniques
67
Physically Based Simulation
68
Physically-based simulation
- Computational Sciences
- Reproduction of physical phenomena
- Predictive capability (accuracy!)
- Substitute for expensive experiments
- Computer Graphics
- Imitation of physical phenomena
- Visually plausible behavior
- Speed, stability, art-directability
PBS and Graphics
69
Simulation in Graphics
- Art-directability
70
Simulation in Graphics
- Speed
https://www.youtube.com/watch?v=-x9B_4qBAkk
71
Simulation in Graphics
- Stability
https://www.youtube.com/watch?v=tT81VPk_ukU
72
Applications in Graphics
73
Applications in Graphics
74
Mass – Spring Systems
75
Spatial Discretization
76
Forces
77
Forces
78
Forces
79
Example: Rope
80
Particle System Forces
- Spring-mass mesh
81
Example: Cloth
82
Demo
83
Equations of Motion
- Newton’s Law for a point mass
- f = ma
- Computing particle motion requires solving
second-order differential equation
- Add variable v to form coupled
first-order differential equations: “state-space form”
84
Solving the Equations of Motion
- Initial value problem
- Know x(0), v(0)
- Can compute force (and therefore acceleration)
for any position / velocity / time
- Compute x(t) by forward integration
f
x(0) x(t)
85
Solving the Equations of Motion
- Forward (explicit) Euler integration
86
Solving the Equations of Motion
- Forward (explicit) Euler integration
- x(t+Δt) x(t) + Δt v(t)
- v(t+Δt) v(t) + Δt f(x(t), v(t), t) / m
87
Solving the Equations of Motion
- Forward (explicit) Euler integration
- x(t+Δt) x(t) + Δt v(t)
- v(t+Δt) v(t) + Δt f(x(t), v(t), t) / m
- Problem:
- Accuracy decreases as Δt gets bigger
88
Single Particle Demo
89
Mass Spring Systems
90
Alternative
91
Continuum Mechanics
https://www.youtube.com/watch?v=BOabEZXm9IE
92
1D Continuous Elasticity
undeformed state
1D elastic solid
←
Given 𝑢, how to determine deformed configuration?
Principle of minimum potential energy A mechanical system in static equilibrium will assume a state of minimum potential energy.
t
deformed state
93
1D Continuous Elasticity
- Strain:
𝜁 =
Δ𝑚 𝑀
(relative stretch)
- Stress:
𝜏 =
𝑔𝑗𝑜𝑢 𝐵
(internal force density)
- Hooke’s law:
𝜏 = 𝑙𝜁 (𝑙 material constant)
- Strain energy density: Ψ =
1 2 𝑙𝜁2
(postulate via 𝜏 =
𝜖Ψ 𝜖𝜁 )
L Δl t A
1D elastic solid
←
𝑔
𝑗𝑜𝑢
undeformed state deformed state
94
1D Continuous Elasticity
- Discretize domain into elements
- Element strain:
𝜁𝑗 =
𝑦𝑗+1
′
−𝑦𝑗
′ −𝑀𝑗
𝑀𝑗
with 𝑀𝑗 = 𝑦𝑗+1 − 𝑦𝑗
- Element strain energy:
𝑋
𝑗 = Ψ𝑗 ⋅ 𝑀𝑗 = 1 2 𝑙𝜁𝑗 2 ⋅ 𝑀𝑗
- Total strain energy:
𝑋 = ∑𝑋
𝑗
t
… … 𝑦1 𝑦2 𝑦3 𝑦𝑜 𝑦1
′
𝑦2
′
𝑦3
′
𝑦𝑜
′
undeformed state deformed state
95
1D Continuous Elasticity
Minimum energy principle: at equilibrium
- system assumes a state of minimum total energy
- total forces vanish for all nodes
- 𝑋
𝑗 = 1 2 𝑙𝜁𝑗 2 ⋅ 𝑀𝑗 and 𝜁𝑗 = 𝑦𝑗+1
′
−𝑦𝑗
′−𝑀𝑗
𝑀𝑗
→
𝜖𝑋𝑗 𝜖𝑦𝑗
′ =
𝜖𝑋𝑗 𝜖𝜁𝑗 𝜖𝜁𝑗 𝜖𝑦𝑗
′ = −𝑙𝜁𝑗
- 𝑔
𝑗 = − 𝜖𝑋 𝜖𝑦𝑗
′ = −
𝜖𝑋𝑗−1 𝜖𝑦𝑗
′ −
𝜖𝑋𝑗 𝜖𝑦𝑗
′ = −𝑙(𝜁𝑗−1 − 𝜁𝑗) for 𝑗 = 2 … 𝑜 − 1
- 𝑔
1 = 𝑙𝜁1 and 𝑔 𝑜 = −𝑙𝜁𝑜−1
t
… … 𝑦1 𝑦2 𝑦3 𝑦𝑜 𝑦1
′
𝑦2
′
𝑦3
′
𝑦𝑜
′
undeformed state deformed state
96
1D Continuous Elasticity
Equilibrium conditions
𝑔
𝑗 =
∀𝑗 ∈ 2 … 𝑜 − 1 −𝑢 𝑗 = 𝑜
→ n-2 linear equations for n-2 unknowns 𝑦𝑗
′
→ solve linear system of equations to obtain deformed configuration.
t
𝑦1 … … 𝑦2 𝑦3 𝑦𝑜 𝑦1
′
𝑦2
′
𝑦3
′
𝑦𝑜
′
𝑢 𝑗 = 1
undeformed state deformed state
97
Stress Strain Curve
- What do these represent?
A: Paper B: Fabric / unfilled plastic C: Rubber
98
Material Models – Linear
𝛀 = 𝟐 𝟑 𝝁𝐮𝐬(𝜻)𝟑+𝝂𝒖𝒔(𝜻𝟑)
99
Material Models – Linear
100
Material Models – Linear
𝜈 = − Δ𝑧 Δ𝑦 = 0.5
101
Negative Poisson’s Ratio
https://www.youtube.com/watch?v=5wpRszZZhYQ
103
Nonlinear Elasticity
- Idea: replace Cauchy strain with Green strain
→ St. Venant-Kirchhoff material (StVK)
- Energy Ψ
𝑇𝑢𝑊𝐿 = 1 2 𝜇tr(𝐅)2+𝜈tr(𝐅2)
- Component 𝑚 of force on node 𝑙 is 𝐠𝑙𝑚
𝑓 = − 𝜖𝑋𝑓 𝜖𝐲𝑙 = − ∑𝑗𝑘 𝜖𝑋𝑓 𝜖𝐆𝑗𝑘
𝑓
𝜖𝐆𝑗𝑘
𝑓
𝜖𝐲𝑙𝑚
- Note:
- Energy is quartic in 𝐲, forces are cubic
- Solve system of nonlinear equations
104
Nonlinear Elasticity
105
Limits
- Real-world materials are not perfectly (hyper)elastic
- Viscosity (stress relaxation, creep)
- Plasticity (irreversible deformation)
- Mullins effect (stiffness depends on strain history)
- Fatigue, damage, …
106
Finite Elements
What is a finite element?
A finite element is a triplet consisting of
- a closed subset Ω𝑓 ⊂ 𝑺𝑒 (in 𝑒 dimensions)
- 𝑜 vectors of nodal variables ഥ
𝒚𝑗 ∈ 𝑺𝑒 describing the reference geometry
- 𝑜 nodal basis functions, 𝑂𝑗: Ω𝑓 → 𝑺
→ 𝑜 vectors of degrees of freedom (e.g., deformed positions 𝒚𝑗)
𝑦 𝑣 𝑦𝑗 𝑣𝑗 = 𝑣𝑗+1 ⋅
𝑦−𝑦𝑗 𝑦𝑗+1−𝑦𝑗 + 𝑣𝑗 ⋅ 𝑦𝑗+1−𝑦 𝑦𝑗+1−𝑦𝑗
𝑦 ∈ 𝑦𝑗, 𝑦𝑗+1 ,𝑗 = 0 … 𝑜 − 1 =
𝑗
𝑣𝑗 ⋅ 𝑂𝑗 𝑦
107
FEM – 1D – Basis Functions
108
Linear Simplicial Elements
1D: line segment 2D: triangle 3D: tetrahedron
- Simplicial elements admit linear basis functions
- Basis functions are uniquely defined through
- reference geometry ഥ
𝒚𝑗 and
- interpolation requirement 𝑂𝑗 ഥ
𝒚𝑘 = 𝜀𝑗𝑘
ഥ 𝒚𝑗 = ҧ 𝑦𝑗 in 1D ഥ 𝒚𝑗 = ( ҧ 𝑦𝑗, ത 𝑧𝑗) in 2D ഥ 𝒚𝑗 = ( ҧ 𝑦𝑗, ത 𝑧𝑗, ҧ 𝑨𝑗) in 3D ഥ 𝒚1 ഥ 𝒚2 ഥ 𝒚3 ഥ 𝒚1 ഥ 𝒚2 ഥ 𝒚4 ഥ 𝒚3 ഥ 𝒚1 ഥ 𝒚2
109
Computing Basis Functions – 2D
i i i i i i
c b a y x y x y x
3 2 1 3 3 2 2 1 1
1 1 1
i i i i i i
y x y x y x c b a
3 2 1 1 3 3 2 2 1 1
1 1 1
- Due to
, we have
ij j i
N ) (x
Example: 3-node elements with linear basis functions
e
1
N
2
N
3
N
- Basis functions are linear:
c y b x a y x N
i i i
) , (
110
Computing Basis Functions – 3D
110 𝑂𝑗 ҧ 𝑦, ത 𝑧, ҧ 𝑨 = 𝑏𝑗 ҧ 𝑦 + 𝑐𝑗 ത 𝑧 + 𝑑𝑗 ҧ 𝑨 + 𝑒𝑗 Ω𝑓 ത 𝐲1 ത 𝐲2 ത 𝐲3 ത 𝐲4 ഥ V𝑓 4-node tetrahedron with 4 linear basis functions … … … …
- Basis functions are linear, 𝑂𝑗
ҧ 𝑦, ത 𝑧, ҧ 𝑨 = 𝑏𝑗 ҧ 𝑦 + 𝑐𝑗 ത 𝑧 + 𝑑𝑗 ҧ 𝑨 + 𝑒𝑗
- From 𝑂𝑗 ഥ
𝒚𝑘 = 𝜀𝑗𝑘 we obtain
112
Example
https://www.youtube.com/watch?v=I46ly-ubzYQ
113
Example
https://vimeo.com/245424174