character animation. contents keyframe animation mocap smooth skin by vertex blending rigging &...

38
Character Animation

Upload: vincent-heath

Post on 16-Jan-2016

246 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Character Animation

Page 2: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Contents

• Keyframe animation• Mocap• Smooth skin by vertex blending• Rigging & retargeting• Gait analysis• (Ragdoll physics)

Fall 2012 2

Page 3: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Keyframe & Inbetweening

Page 4: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Keyframe Interpolation1

• Periodic motion, with n keys, period T– Each key contains the pose-defining parameters

• At time t, subtract integer multiples of T (so that 0 t* < T)• Use t* to determine the interpolating keys

– the max i with t(i) < t*

• Linearly interpolate key(i) and key(i+1)

Key1t1

Key2t2

Keyntn

Key3t3

T

Page 5: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Keyframe Interpolation2

Key1t1

Key(i)t(i)

Keyntn

Key(i+1)t(i+1)

T

1*

1

*

*

keykey)1(key

ii

ii

i

Tt

ss

tt

tts

Ttrunctt

1*

1

*

*

keykey)1(key

ii

ii

i

Tt

ss

tt

tts

Ttrunctt

Page 6: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Quake II(雷神之錘 II )

• First-person shooter game by id software in 1997• Md2: the model format used by Quake II• Model archive: http://planetquake.gamespy.com/quake2/

Fall 2012 6

Page 7: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Better than linear interpolation

Fall 2012 7

Page 8: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

MOCAP

• Motion Capture– File format: ASF/AMC– Database, mixamo – Sample program

Fall 2012 8

Page 10: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

ASF/AMC (ref)

• ASF (Acclaim Skeleton File)• AMC (Acclaim Motion Capture data)• :root• :bonedata• :hierarchy

Fall 2012 10

Page 11: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Root

• "axis" keyword in the root section defines the rotation order of the root object.

• "order" keyword specifies the channels of motion that are applied to the root and in what order they will appear in the AMC file.

• "position" and "orientation" keywords are each followed by a triplet of numbers indicating the starting position and orientation of the root. These are typically, but not always, zero.

Fall 2012 11

Page 12: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Bonedata (ref)• "id" unique id for the segment• "name" alphabetic identifier for bone.• "direction" the direction of the segment in (world coordinate system)• "length" The length of the segment. • "axis" an axis of rotation for the segment. The axis line indicates the initial

orientation of a bone’s axes relative to fixed, global axes• "dof"  The dof line tokens determine:

– what degrees-of-freedom exist between a bone and its parent– the order in which these degrees-of-freedom are written in the AMC file– the sequence in which rotations are applied to the bone

• "limits" For each channel that appears there will be a pair of numbers inside parenthesis indicating the minimum and maximum allowed value for that channel

Fall 2012 12

Page 13: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Example

Fall 2012 13

Page 14: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

In-Depth Bonedata

Fall 2012 14

Page 15: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

lfemur

Fall 2012 15

Page 16: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

lfoot

Fall 2012 16

Page 17: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Fall 2012 17

From Lee and Koh (1995)

Euler angles in ASF

In v’=Mv convention

Fall 2012 17

,,,,,, xRotyRotzRotzRotyRotxRot

,,

,,,,,,

xRotzRot

zRotzRotxRotzRotzRotxRot

Page 18: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Transformation Code

Fall 2012 18

Page 19: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Skinning

References:Rotenburg(UCSD), Frost (UCI), code

Page 20: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Skinning Introduction• 3D character models play an important role in

gaming• Organic models are more complex to render than

rigid models– Organic: humans, animals, etc.– Rigid: building, rock, etc.– The mesh that defines the shape of the model constantly

changes as the models animate

Fall 2012 20

Page 21: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Skinning Introduction (cont)

• The animating mesh is referred to as a “skin”• Skinning is the process of animating the mesh • Skinning has been traditionally done on the

CPU• As 3D character models complexity increases,

skinning is done on the video cards using vertex shaders

Fall 2012 21

Page 22: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Methods to Animate Skinned Characters

• Keyframe animation (as in MD2)– Save characters in “keyframes” and blend– Suitable for low polygon models – On high-detail models, it can be memory intensive

• Matrix palette skinning– Weighting individual points to the bones– Just the skeletal animation needs to be saved (rather than

the whole models in keyframes)

• Not mutually exclusive– Face/hand for keyframes; matrix palette for the rest

Fall 2012 22

Page 23: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Vertex Blending

• Also known as:– Matrix palette, skeleton-subspace deformation

Fall 2012 23

Page 24: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

How Bones are Created

• Obtain the skin model• Duplicate the skin• Scale down fractionally• Cut the smaller skin into smaller body parts

which are used as bones

Fall 2012 24

Page 25: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Skinning

Simple Skin•every vertex of the continuous skin mesh is attached to a joint.•every vertex is transformed exactly once.

Smooth Skin•a vertex can be attached to more than one joint with adjustable weights that control how much each joint affects it•Vertices rarely need to be attached to more than three joints•Each vertex is transformed a few times and the results are blended

Wvv

1

...2211

iii

NN

wwherew

www

Mvv

MvMvMvv

Fall 2012 25

Page 26: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Smooth Skin – Binding Matrix

• we use a binding matrix B for each joint that defines where the joint was when the skin was attached and premultiply its inverse with the world matrix:

iii WBM 1

Fall 2012 26

Page 27: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

1.0/0.0 0.0/1.00.5/0.50.7/0.3

Fall 2012 27

Page 28: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

• To compute shading, we need to transform the normals to world space also

• If the matrices have non-rigid transformations, then technically, we should use:

Tii

Tii

w

w1

1

Mn

Mnn

Fall 2012 28

Page 29: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Limitation

• Smooth skin is very simple and quite fast, but its quality is limited– Joints tend to collapse as they bend more– Very difficult to get specific control– Unintuitive and difficult to edit

• Still, it is common in games and commercial animation!

Fall 2012 29

Page 30: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Fall 2012 30

Page 31: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Other Topics

Rigging, retargeting, gait analysis, ragdoll physics

Page 32: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

What is rigging (ref)

• A character rig is essentially a digital skeleton bound to the 3D mesh. Like a real skeleton, a rig is made up of joints and bones, each of which act as a "handle" that animators can use to bend the character into a desired pose.

Fall 2012 32

Page 33: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Automatic Rigging (Baran & Popovic, 2007)

Fall 2012 33

Page 34: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Automatic Rigging (cont)

Fall 2012 34

Page 35: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Retargeting Animation from Rig to Rig (ref)

• When you retarget animation between rigs, the retargeting operator figures out which rig elements match based on their tags. Then it maps and generates the animation that is transferred to the target rig.

• Online motion retargeting 1999• Youtube (havok)

Fall 2012 35

Page 36: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Mixamo

• Auto-Rigger (youtube)

Fall 2012 36

Page 37: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Gait• Gait is the pattern of movement of the limbs of animals, including humans, during

locomotion over a solid substrate. Most animals use a variety of gaits, selecting gait based on speed, terrain, the need to maneuver, and energetic efficiency. Different animal species may use different gaits due to differences in anatomy that prevent use of certain gaits, or simply due to evolved innate preferences as a result of habitat differences.

Fall 2012 37

Page 38: Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall 20122

Ragdoll physics

• Verlet integration• IK postprocessing

Fall 2012 38