Top Banner
Introduction to Computer Graphics – Animation (1) – May 19, 2016 Kenshi Takayama
40

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

Mar 27, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2016/slides/iscg-2016-05-animation1...Introduction to Computer Graphics ... ‒𝐯′:

Introduction to Computer Graphics

– Animation (1) –

May 19, 2016

Kenshi Takayama

Page 2: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-05-animation1...Introduction to Computer Graphics ... ‒𝐯′:

Mocap designed for outdoor scene

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

Page 11: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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

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

Skinning

16

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

17

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

18

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

19

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

20

Page 21: Introduction to Computer Graphics Animation (1)research.nii.ac.jp/~takayama/teaching/utokyo-iscg-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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-2016/slides/iscg-2016-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