introduction to computer graphics animation...

40
Introduction to Computer Graphics – Animation (1) – May 18, 2017 Kenshi Takayama

Upload: others

Post on 27-Mar-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Introduction to Computer Graphics

– Animation (1) –

May 18, 2017

Kenshi Takayama

Page 2: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Skeleton-based animation

• Simple

• Intuitive

• Low comp. cost

2

https://www.youtube.com/watch?v=DsoNab58QVA

Page 3: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Representing a pose using skeleton

• Tree structure consisting of bones & joints

• Each bone holds relative rotation angle w.r.t. parent joint

• Whole body pose determined by the set of joint angles(Forward Kinematics)

• Deeply related to robotics

3

Page 4: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Inverse Kinematics

• Find joint angles s.t. an end effector comes at a given goal position

• Typical workflow:• Quickly create pose

using IK, fine adjustment using FK

4

https://www.youtube.com/watch?v=e1qnZ9rV_kw

Page 5: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Simple method to solve IK: Cyclic Coordinate Descent• Change joint angles one by one

• S.t. the end effector comes as close as possible to the goal position

• Ordering is important! Leaf root

• Easy to implement Basic assignment

• More advanced• Jacobi method (directional constraint)

• Minimizing elastic energy [Jacobson 12]

5http://mukai-lab.org/wp-content/uploads/2014/04/CcdParticleInverseKinematics.pdf

Page 6: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

IK minimizing elastic energy

6Fast Automatic Skinning Transformations [Jacobson SIGGRAPH12]https://www.youtube.com/watch?v=PRcXy2LjI9I

Page 7: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Ways to obtain/measure motion data

7

Page 8: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Optical motion capture

• Put markers on the actor, record video from many viewpoints (~48)

8https://www.youtube.com/watch?v=c6X64LhcUyQfrom Wikipedia

Page 9: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Mocap using inexpensive depth camera

9https://www.youtube.com/watch?v=qC-fdgPJhQ8

Page 10: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Mocap designed for outdoor scene

10Motion Capture from Body-Mounted Cameras [Shiratori SIGGRAPH11]

https://www.youtube.com/watch?v=xbI-NWMfGPs

Page 11: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Motion database• http://mocap.cs.cmu.edu/

• 6 categories, 2605 in total

• Free for research purposes• Interpolation, recombination, analysis, search, etc.

11

Page 12: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Recombining motions

• Allow transition from one motion to another if poses are similar in certain frame

12

Motion Graphs [Kovar SIGGRAPH02]

Motion Patches: Building Blocks for Virtual Environments Annotated with Motion Data [Lee SIGGRAPH06]

http://www.tcs.tifr.res.in/~workshop/thapar_igga/motiongraphs.pdf

Pose similarity matrix

frame

fram

e

Page 13: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Generating motion through simulation

• For creatures unsuitable for mocap• Too dangerous,

nonexistent, ...

• Natural motion respecting body shape

• Can interact with dynamic environment

13Generalizing Locomotion Style to New Animals With Inverse Optimal Regression [Wampler SIGGRAPH14]

https://www.youtube.com/watch?v=KF_a1c7zytw

Page 14: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Creating poses using special devices

14Tangible and Modular Input Device for Character Articulation [Jacobson SIGGRAPH14]

Rig Animation with a Tangible and Modular Input Device [Glauser SIGGRAPH16]

https://www.youtube.com/watch?v=vBX47JamMN0

Page 15: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Many topics about character motion

15

Character motion synthesis by topology coordinates [Ho EG09]

Aggregate Dynamics for Dense Crowd Simulation [Narain SIGGRAPHAsia09]

Synthesis of Detailed Hand Manipulations Using Contact Sampling [Ye SIGGRAPH12]

Space-Time Planning with Parameterized Locomotion Controllers.[Levine TOG11]

Interaction between

multiple persons

Crowd simulation

Grasping motion

Path planning

https://www.youtube.com/

watch?v=1S_6wSKI_nU

https://www.youtube.com/

watch?v=pqBSNAOsMDc

https://www.youtube.com/

watch?v=x8c27XYTLTo

https://vimeo.com/33409868

Page 16: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Skinning

16

Page 17: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

17

Page 18: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

18

Page 19: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

19

Page 20: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

20

Page 21: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

𝐯𝑖′ = blend 𝑤𝑖,1, 𝐓1 , 𝑤𝑖,2, 𝐓2 , … 𝐯𝑖

• Input• Vertex positions 𝐯𝑖 𝑖 = 1, … , 𝑛

• Transformation per bone 𝐓𝑗 𝑗 = 1, … , 𝑚

• Weight from each bone to each vertex 𝑤𝑖,𝑗 𝑖 = 1, … , 𝑛 𝑗 = 1, … , 𝑚

• Output• Vertex positions after deformation 𝐯𝑖

′ 𝑖 = 1, … , 𝑛

• Main focus• How to define weights 𝑤𝑖,𝑗

• How to blend transformations21

Page 22: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Simple way to define weights: painting

22https://www.youtube.com/watch?v=TACB6bX8SN0

Page 23: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Automatic weight computation

• Define weight 𝑤𝑗 as a smooth scalar field that takes 1 on the j-th bone and 0 on the other bones

• Minimize 1st-order derivative Ω𝛻𝑤𝑗

2𝑑𝐴 [Baran 07]

• Approximate solution only on surface easy & fast

• Minimize 2nd-order derivative ΩΔ𝑤𝑗

2𝑑𝐴 [Jacobson 11]

• Introduce inequality constraints 0 ≤ 𝑤𝑗 ≤ 1

• Quadratic Programming over the volume high-quality

23Automatic rigging and animation of 3d characters [Baran SIGGRAPH07]

Bounded Biharmonic Weights for Real-Time Deformation [Jacobson SIGGRAPH11]

Pinocchio demo

Page 24: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Simple way to blend transformations:Linear Blend Skinning• Represent rigid transformation 𝐓𝑗 as a 3×4 matrix consisting of

rotation matrix 𝐑𝑗 ∈ ℝ3×3 and translation vector 𝐭𝑗 ∈ ℝ3

𝐯𝑖′ =

𝑗

𝑤𝑖,𝑗 𝐑𝑗 𝐭𝑗𝐯𝑖

1

• Simple and fast

• Implemented using vertex shader: send 𝐯𝑖 & 𝑤𝑖,𝑗 to GPU at initialization,

send 𝐓𝑗 to GPU at each frame

• Standard method

24

Page 25: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Artifact of LBS: ”candy wrapper” effect

• Linear combination of rigid transformation is not a rigid transformation!• Points around joint concentrate when twisted

25

Initial shape & two bones

Twist one bone

Deformation using LBS

Page 26: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Alternative to LBS: Dual Quaternion Skinning

• Idea• Quaternion (four numbers) 3D rotation

• Dual quaternion (two quaternions) 3D rigid motion (rotation + translation)

26

Initial shape & two bones Deformation using LBS Deformation using DQS

Page 27: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Dual number & dual quaternion

• Dual number• Introduce dual unit 𝜀 & its arithmetic rule 𝜀2 = 0 (cf. imaginary unit 𝑖)

• Dual number is sum of primal & dual components:

• Dual conjugate: 𝑎 = 𝑎0 + 𝜀𝑎𝜀 = 𝑎0 − 𝜀𝑎𝜀

• Dual quaternion• Quaternion whose elements are dual numbers

• Can be written using two quaternions

• Dual conjugate: 𝐪 = 𝐪0 + 𝜀𝐪𝜀 = 𝐪0 − 𝜀𝐪𝜀

• Quaternion conjugate: 𝐪∗ = 𝐪0 + 𝜀𝐪𝜀∗ = 𝐪0

∗ + 𝜀𝐪𝜀∗

27Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]

𝐪 ≔ 𝐪0 + 𝜀𝐪𝜀

𝑎 ≔ 𝑎0 + 𝜀𝑎𝜀

𝑎0, 𝑎𝜀 ∈ ℝ

Page 28: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Arithmetic rules for dual number/quaternion

• For dual number 𝑎 = 𝑎0 + 𝜀𝑎𝜀 :

• Reciprocal1

𝑎=

1

𝑎0− 𝜀

𝑎𝜀

𝑎02

• Square root 𝑎 = 𝑎0 + 𝜀𝑎𝜀

2 𝑎0

• Trigonometric sin 𝑎 = sin 𝑎0 + 𝜀𝑎𝜀 cos 𝑎0cos 𝑎 = cos 𝑎0 − 𝜀𝑎𝜀 sin 𝑎0

• For dual quaternion 𝐪 = 𝐪0 + 𝜀𝐪𝜀 :

• Norm 𝐪 = 𝐪∗ 𝐪 = 𝐪0 + 𝜀𝐪0,𝐪𝜀

𝐪0

• Inverse 𝐪−1 = 𝐪∗

𝐪 2

• Unit dual quaternion satisfies 𝐪 = 1• ⟺ 𝐪0 = 1 & 𝐪0, 𝐪𝜀 = 0

28

Dot product as 4D vectors

Easily derived by combining usual

arithmetic rules with new rule 𝜀2 = 0

From Taylor expansion

Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]

Page 29: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Rigid transformation using dual quaternion

• Unit dual quaternion representing rigid motion of

translation 𝐭 = 𝑡𝑥 , 𝑡𝑦 , 𝑡𝑧 and rotation 𝐪0 (unit quaternion) :

𝐪 = 𝐪0 +𝜀

2 𝐭𝐪0

• Rigid transformation of 3D position 𝐯 = 𝑣𝑥 , 𝑣𝑦 , 𝑣𝑧 using unit dual quaternion 𝐪 :

𝐪 1 + 𝜀𝐯 𝐪∗ = 1 + 𝜀𝐯′

• 𝐯′ : 3D position after transformation

29

Note: 3D vector is considered as

quaternion with zero real part

Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]

Page 30: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Rigid transformation using dual quaternion

• 𝐪 = 𝐪0 +𝜀

2 𝐭𝐪0

• 𝐪 1 + 𝜀𝐯 𝐪∗ = 𝐪0 +𝜀

2 𝐭𝐪0 1 + 𝜀𝐯 𝐪0

∗ +𝜀

2𝐪0

∗ 𝐭

= 𝐪0 +𝜀

2 𝐭𝐪0 𝐪0

∗ + 𝜀𝐯𝐪0∗ +

𝜀

2𝐪0

∗ 𝐭

= 𝐪0𝐪0∗ +

𝜀

2 𝐭𝐪0𝐪0

∗ + 𝜀𝐪0𝐯𝐪0∗ +

𝜀

2𝐪0𝐪0

∗ 𝐭

= 1 + 𝜀 𝐭 + 𝐪0𝐯𝐪0∗

30

0 + 𝐭 𝐪0

∗= 𝐪0

∗ 0 + 𝐭∗

= −𝐪0∗ 𝐭

𝐪02 = 1

3D position 𝐯 rotated by quaternion 𝐪0

Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]

Page 31: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Rigid transformation as “screw motion”

• Any rigid motion is uniquely described as screw motion• (Up to antipodality)

31

Conventional notion: rotation + translation Screw motion

Axis direction

Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]

Page 32: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Screw motion & dual quaternion

• Unit dual quaternion 𝐪 can be written as:

𝐪 = cos 𝜃

2+ 𝐬 sin

𝜃

2• 𝜃 = 𝜃0 + 𝜀𝜃𝜀 𝜃0, 𝜃𝜀 : real number

• 𝐬 = 𝐬0 + 𝜀𝐬𝜀 𝐬0, 𝐬𝜀 : unit 3D vector

• Geometric meaning• 𝐬0 : direction of rotation axis

• 𝜃0 : amount of rotation

• 𝜃𝜀 : amount of translation parallel to 𝐬0

• 𝐬𝜀 : when rotation axis passes through 𝐫,it satisfies 𝐬𝜀 = 𝐫 × 𝐬0

32Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]

Page 33: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Interpolating two rigid transformations

• Linear interpolation + normalization (nlerp)

nlerp 𝐪1, 𝐪2, 𝑡 ≔1−𝑡 𝐪1+𝑡 𝐪2

1−𝑡 𝐪1+𝑡 𝐪2

• Note: 𝐪 & − 𝐪 represent same transformation with opposite path

• If 4D dot product of non-dual components of 𝐪1 & 𝐪2 is negative, use − 𝐪2 in the interpolation

33

Page 34: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Blending rigid motions using dual quaternion

blend 𝑤1, 𝐪1 , 𝑤2, 𝐪2 , … ≔𝑤1 𝐪1 + 𝑤2 𝐪2 + ⋯

𝑤1 𝐪1 + 𝑤2 𝐪2 + ⋯

• Akin to blending rotations using quaternion

• Same input format as LBS & low computational cost

• Standard feature in many commercial CG packages

34Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]

Page 35: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Artifact of DQS: ”bulging” effect

• Produces ball-like shape around the joint when bended

35

LBS DQS

Elasticity-Inspired Deformers for Character Articulation [Kavan SIGGRAPHAsia12]

Bulging-free dual quaternion skinning [Kim CASA14]

Page 36: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Overcoming DQS’s drawback

36

Decompose transformation into bend & twist,

interpolate them separately [Kavan12]

Elasticity-Inspired Deformers for Character Articulation [Kavan SIGGRAPHAsia12]

Bulging-free dual quaternion skinning [Kim CASA14]

LBS DQS [Kavan12]

After deforming using DQS,

offset vertices along normals [Kim14]

LBS DQS [Kavan12]

Page 37: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Limitation of DQS: Cannot represent rotation by more than 360°

37Differential Blending for Sketch-based Expressive Posing [Oztireli SCA13]

Page 38: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Skinning for avoiding self-intersections

• Make use of implicit functions

38Implicit Skinning; Real-Time Skin Deformation with Contact Modeling [Vaillant SIGGRAPH13]

https://www.youtube.com/watch?v=RHySGIqEgyk

Page 39: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

Other deformation mechanisms than skinning

39Bounded Biharmonic Weights for Real-Time Deformation [Jacobson SIGGRAPH11]

https://www.youtube.com/watch?v=P9fqm8vgdB8

Unified point/cage/skeleton handles [Jacobson 11]

https://www.youtube.com/watch?v=BFPAIU8hwQ4

BlendShape

Page 40: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2017/slides/iscg-2017-05-animation1...Introduction to Computer Graphics ... •𝐯′:

References

• http://en.wikipedia.org/wiki/Motion_capture

• http://skinning.org/

• http://mukai-lab.org/category/library/legacy

40