Introduction to Computer Graphics – Animation (1) – May 23, 2019 Kenshi Takayama
Skeleton-based animation • Simple • Intuitive • Low comp. cost https://www.youtube.com/watch?v=DsoNab58QVA 2
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 ( F orward K inematics) • Deeply related to robotics 3
I nverse K inematics • 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 https://www.youtube.com/watch?v=e1qnZ9rV_kw 4
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] 5 https://mukai-lab.org/content/CcdParticleInverseKinematics.pdf
IK minimizing elastic energy https://www.youtube.com/watch?v=PRcXy2LjI9I 6 Fast Automatic Skinning Transformations [Jacobson SIGGRAPH12]
Ways to obtain/measure motion data 7
Optical motion capture • Put markers on the actor, record video from many viewpoints (~48) from Wikipedia https://www.youtube.com/watch?v=c6X64LhcUyQ 8
Mocap using inexpensive depth camera https://www.youtube.com/watch?v=qC-fdgPJhQ8 9
Mocap designed for outdoor scene https://www.youtube.com/watch?v=xbI-NWMfGPs 10 Motion Capture from Body-Mounted Cameras [Shiratori SIGGRAPH11]
Motion database • http://mocap.cs.cmu.edu/ • 6 categories, 2605 in total • Free for research purposes • Interpolation, recombination, analysis, search, etc. 11
Recombining motions • Allow transition from one motion to another if poses are similar in certain frame frame frame Pose similarity matrix 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 12
Generating motion through simulation • For creatures unsuitable for mocap • Too dangerous, nonexistent, ... • Natural motion respecting body shape • Can interact with dynamic environment https://www.youtube.com/watch?v=KF_a1c7zytw 13 Generalizing Locomotion Style to New Animals With Inverse Optimal Regression [Wampler SIGGRAPH14]
Creating poses using special devices https://www.youtube.com/watch?v=vBX47JamMN0 Tangible and Modular Input Device for Character Articulation [Jacobson SIGGRAPH14] 14 Rig Animation with a Tangible and Modular Input Device [Glauser SIGGRAPH16]
Many topics about character motion Interaction between Grasping motion multiple persons https://www.youtube.com/ https://www.youtube.com/ watch?v=x8c27XYTLTo watch?v=1S_6wSKI_nU Crowd simulation Path planning https://www.youtube.com/ https://vimeo.com/33409868 watch?v=pqBSNAOsMDc 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] 15 Space-Time Planning with Parameterized Locomotion Controllers.[Levine TOG11]
Skinning 16
17
18
19
20
′ = 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 transformations 21
Simple way to define weights: painting https://www.youtube.com/watch?v=TACB6bX8SN0 22
Automatic weight computation • Define weight 𝑥 𝑘 as a smooth scalar field that takes 1 on the j-th bone and 0 on the other bones 2 𝑒𝐵 • Minimize 1 st -order derivative [Baran 07] 𝛼𝑥 𝑘 Ω • Approximate solution only on surface easy & fast 2 𝑒𝐵 [Jacobson 11] • Minimize 2 nd -order derivative Ω Δ𝑥 𝑘 • Introduce inequality constraints 0 ≤ 𝑥 𝑘 ≤ 1 • Quadratic Programming over the volume high-quality Pinocchio demo Automatic rigging and animation of 3d characters [Baran SIGGRAPH07] 23 Bounded Biharmonic Weights for Real-Time Deformation [Jacobson SIGGRAPH11]
Simple way to blend transformations: L inear B lend S kinning • 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
Artifact of LBS: ”candy w rapper” effect Twist one bone Initial shape & two bones Deformation using LBS • Linear combination of rigid transformation is not a rigid transformation! • Points around joint concentrate when twisted 25
Alternative to LBS: D ual Q uaternion S kinning Initial shape & two bones Deformation using LBS Deformation using DQS • Idea • Quaternion (four numbers) 3D rotation • Dual quaternion (two quaternions) 3D rigid motion (rotation + translation) 26
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: 𝑏 ≔ 𝑏 0 + 𝜁𝑏 𝜁 ො • Dual conjugate: 𝑏 0 , 𝑏 𝜁 ∈ ℝ ത 𝑏 = 𝑏 0 + 𝜁𝑏 𝜁 = 𝑏 0 − 𝜁𝑏 𝜁 ො • Dual quaternion • Quaternion whose elements are dual numbers • Can be written using two quaternions ෝ 𝐫 ≔ 𝐫 0 + 𝜁𝐫 𝜁 • Dual conjugate: ഥ ෝ 𝐫 = 𝐫 0 + 𝜁𝐫 𝜁 = 𝐫 0 − 𝜁𝐫 𝜁 𝐫 ∗ = 𝐫 0 + 𝜁𝐫 𝜁 ∗ = 𝐫 0 ∗ + 𝜁𝐫 𝜁 • Quaternion conjugate: ∗ ෝ 27 Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]
Arithmetic rules for dual number/quaternion • For dual number ො 𝑏 = 𝑏 0 + 𝜁𝑏 𝜁 : 1 1 𝑏 𝜁 • Reciprocal 𝑏 = 𝑏 0 − 𝜁 Easily derived by combining usual 2 ො 𝑏 0 arithmetic rules with new rule 𝜁 2 = 0 𝑏 𝜁 • Square root 𝑏 = ො 𝑏 0 + 𝜁 2 𝑏 0 • Trigonometric sin ො 𝑏 = sin 𝑏 0 + 𝜁𝑏 𝜁 cos 𝑏 0 From Taylor expansion cos ො 𝑏 = cos 𝑏 0 − 𝜁𝑏 𝜁 sin 𝑏 0 • For dual quaternion ෝ 𝐫 = 𝐫 0 + 𝜁𝐫 𝜁 : Dot product as 4D vectors 𝐫 0 ,𝐫 𝜁 • Norm 𝐫 ∗ ෝ 𝐫 ෝ = ෝ 𝐫 = 𝐫 0 + 𝜁 𝐫 0 𝐫 ∗ 𝐫 −1 = ෝ • Inverse ෝ 𝐫 2 ෝ • Unit dual quaternion satisfies ෝ 𝐫 = 1 = 1 & 𝐫 0 , 𝐫 𝜁 = 0 • ⟺ 𝐫 0 28 Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]
Rigid transformation using dual quaternion • Unit dual quaternion representing rigid motion of translation Ԧ 𝐮 = 𝑢 𝑦 , 𝑢 𝑧 , 𝑢 𝑨 and rotation 𝐫 0 (unit quaternion) : 𝐫 = 𝐫 0 + 𝜁 Note: 3D vector is considered as 2 Ԧ ෝ 𝐮𝐫 0 quaternion with zero real part • Rigid transformation of 3D position 𝐰 = 𝑤 𝑦 , 𝑤 𝑧 , 𝑤 𝑨 using unit dual quaternion ෝ 𝐫 : 𝐫 ∗ = 1 + 𝜁𝐰 ′ 𝐫 1 + 𝜁𝐰 ෝ ෝ • 𝐰 ′ : 3D position after transformation 29 Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]
Rigid transformation using dual quaternion 𝜁 • ෝ 2 Ԧ 𝐫 = 𝐫 0 + 𝐮𝐫 0 ∗ 𝜁 ∗ + 𝜁 ∗ Ԧ 𝐫 ∗ = 𝐫 0 + ∗ ∗ 0 + Ԧ • ෝ 2 Ԧ 0 + Ԧ 𝐫 1 + 𝜁𝐰 ෝ 𝐮𝐫 0 1 + 𝜁𝐰 𝐫 0 2 𝐫 0 𝐮 𝐮 𝐫 0 = 𝐫 0 𝐮 ∗ Ԧ = −𝐫 0 𝐮 𝜁 ∗ + 𝜁𝐰𝐫 0 ∗ + 𝜁 ∗ Ԧ 2 Ԧ = 𝐫 0 + 𝐮𝐫 0 𝐫 0 2 𝐫 0 𝐮 ∗ + 𝜁 ∗ + 𝜁𝐫 0 𝐰𝐫 0 ∗ + 𝜁 ∗ Ԧ 2 Ԧ = 𝐫 0 𝐫 0 𝐮𝐫 0 𝐫 0 2 𝐫 0 𝐫 0 𝐮 𝐫 0 2 = 1 ∗ = 1 + 𝜁 Ԧ 𝐮 + 𝐫 0 𝐰𝐫 0 3D position 𝐰 rotated by quaternion 𝐫 0 30 Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]
Rigid transformation as “screw motion” Conventional notion: rotation + translation Screw motion Axis direction • Any rigid motion is uniquely described as screw motion • (Up to antipodality) 31 Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]
Screw motion & dual quaternion • Unit dual quaternion ෝ 𝐫 can be written as: መ መ 𝜄 𝜄 ෝ 𝐫 = cos 2 + ො 𝐭 sin 2 • 𝜄 0 , 𝜄 𝜁 : real number 𝜄 = 𝜄 0 + 𝜁𝜄 𝜁 • ො 𝐭 0 , 𝐭 𝜁 : unit 3D vector 𝐭 = 𝐭 0 + 𝜁𝐭 𝜁 • 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 32 Geometric Skinning with Approximate Dual Quaternion Blending [Kavan TOG08]
Recommend
More recommend