66
Character Animation and Skinning

Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Character Animation and Skinning

Page 2: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Motion over time

Animation

Page 3: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Lead animator draws sparse key frames

Secondary artists fill in (by hand) the intermediate frames: inbetweening

Traditional Character Animation

Page 4: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Computer Character Animation

How to inbetween automatically on a 2D sprite?

Page 5: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Surround object with animation cage

Moving the cage moves interior points

Cage-Based Animation

Page 6: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Simplest Cage: Triangle

Use barycentric interpolation

Matches points’ pixels between triangles

Page 7: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Polygonal Cages

Must generalize barycentric coordinates to arbitrary polygons

Many ways to do this: generalized barycentric coordinates not unique

Page 8: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Generalized Barycentric Coordinates

Page 9: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Polygonal Cages

Other properties:1. Weights must be

positive inside the polygon (or get leaks)

Page 10: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Polygonal Cages

Other properties:1. Weights must be

positive inside the polygon (or get leaks)

2. Weights must unique (or get flips)

Page 11: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Polygonal Cages

Other properties:1. Weights must be positive inside the

polygon (or get leaks)2. Weights must unique (or get flips)3. Smooth4. Easy to compute

Page 12: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Some Possible Schemes

Wachspress CoordinatesMean-value CoordinatesGreen CoordinatesBounded Biharmonic Weightsetc…

Page 13: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Cage-Based Animation

Extends to 3D from 2D naturally

Full control, but not intuitive

Page 14: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Handle-Based Animation

Pick special points (handles) on object

Moving handles moves nearby points

Page 15: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Character Rigs

Skeletons inside the geometry

the industry standardfor character animation

moving bones movessurrounding geometry

how to build rig?

Page 16: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Building a RigUsually done by hand using Maya etc.

Expressiveness/complexity tradeoff

Page 17: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Rigging in Practice

https://www.youtube.com/watch?v=WxZz-yH-mKU

Page 18: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Building a Rig

Some automatic tools exist…

[Pinocchio][Mixamo]

Page 19: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Mixamo Demo

https://www.mixamo.com/

Automatic rigging can work well for humans/humanlike objects• Assumes bipedal with standard

placement and orientation of joints

Page 20: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Not so impressive for arbitrary characters…

https://www.youtube.com/watch?v=-5jWtz3rzco

Page 21: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Representing a Rig

Tree of bones connected by joints

bones have two endpoints• first attached to parent

Page 22: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Bone Local Coordinates

Origin O One natural direction: tangent axis

Page 23: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Bone Local Coordinates

Origin O One natural direction: tangent axis Two perpendicular directions:

Page 24: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Bone Local Coordinates

Origin O One natural direction: tangent axis Two perpendicular directions:

second endpoint:

Page 25: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Bone Local Coordinates

Child bone can be expressed in terms of parent coordinate system

Page 26: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

In local coordinates:

Bone to World Coordinates

Page 27: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

In local coordinates: In world coordinates:

Bone to World Coordinates

Page 28: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

What About the Base?

Page 29: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

What About the Base?

write origin & axes in world coordinates, then

Page 30: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Forward Kinematics

changing also changes child coordinate systems

Page 32: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Skinning

Moving bones moves the character

Closer bones have more influence

Page 33: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Nearest-Bone Skinning

Given: undeformed (rest) skeleton and deformed skeleton

Page 34: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Coordinate Systems

undeformed bone

world

deformed bone

Page 35: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Coordinate Systems

undeformed bone

world

deformed bone

Page 36: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Coordinate Systems

undeformed bone

world

deformed bone

Page 37: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Coordinate Systems

undeformed bone

world

deformed bone

Page 38: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Coordinate Systems

undeformed bone deformed bone

Key (and confusing) point: • maps from undeformed local to

world coords (doesn’t move point) • Identity maps undeformed to deformed

bone coords (and does move point)

Page 39: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Nearest-Bone Skinning

Undeformed to deformed skin position (world coordinates):

Page 40: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Nearest-Bone Skinning

Undeformed to deformed skin position (world coordinates):

changes during animation

Page 41: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Problems with Nearest-Bone

Which bone does point belong to?

Page 42: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Problems with Nearest-Bone

Which bone does point belong to? One solution: average -1

Page 43: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Linear-Blend Skinning

Each vertex feels weighted average of each bone’s transformations

Nearby bones have higher

weight

Page 44: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Linear-Blend Skinning

How to determine skinning weights w?

Page 45: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Linear-Blend Skinning

How to determine skinning weights w?

• Use only nearest bone

• Spatially blend the weights

• In practice: paint weights by hand

Page 46: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Painting Weights

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

Page 47: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

The “Arm Twist” Problem

(Why does this happen?)

Page 48: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Blending Transformations

Each individual bone undergoes a rigid transformation• Combination rotation and translation

• Linear blend of rigid motions not rigid

Page 49: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Blending Transformations

Translations alone: trivial to blend Rotations alone: blend using SLERP • use quaternions • do not use Euler angles!

Page 50: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Separate TransformsBlending Transformations

Idea: separately blend translation and rotation components of rigid motion

Page 51: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Separate Transforms: Problem

where is the child bone half way in between the motion?

(where it the origin?)

T1

T2

Page 52: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Separate Transforms: Problem

where is the child bone half way in between the motion?

(where it the origin?)

Page 53: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Separate Transforms: Problem

where is the child bone half way in between the motion?

(where it the origin?)

Page 54: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Separate Transforms: Problem

Blended transformation not coordinate-independent

• different origin positions in bone hierarchy result in different blends

• unify translation and rotation into single state

• blend centers of rotation

Page 55: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Dual Quaternion Skinning• No more arm twisting issues• Less deformation• The industry standard (used in Maya, etc)

Page 56: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Dual Quaternion Skinning• Expresses a rotation (quaternion) and

translation• Blended dual quaternions represent a

rotation and translation as quaternions

·q =∑n

i=1 wi·qi

∥ ∑ni=1 wi

·qi∥

·q = qr + qdεwhere

qr = rqd =

12

tr

Page 57: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Dual Quaternion Skinning

Prevents loss of volume during rigid motion

https://cs.gmu.edu/~jmlien/teaching/cs451/uploads/Main/dual-quaternion.pdf

Page 58: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Other Skinning Challenges

Volume Conservation

Page 59: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Other 3D Animation Techniques

Anatomy-based animation• simulate the tendons and muscles

Most correct motionRestricted to “real” animalsSlow

Page 60: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Other 3D Animation Techniques

Faces are hard to rig: many muscles

instead, precomputea small set of basisdeformations

blend between them(blendshapes)

knobs not alwaysintuitive

Page 61: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Other 3D Animation Techniques

SCAPE: data-driven statistical model of human body shapes

rig a “mean” template human once by hand

for an arbitrary human,transfer the rig by fittingto a SCAPE model

works well only for (nearly) naked humans

Page 62: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Simplifying Keyframing

Simulation (“inverse kinematics”)

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

Page 63: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Motion Capture

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

Page 64: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Machine Learning and Motion Synthesis

• Machine learning can allow for good-looking animations

• https://www.youtube.com/watch?v=urf-AAIwNYk

• Can lower cost of artistic pipeline• Downside is that learned function is mostly

unmodifiable/incomprehensible• Difficult to correct in pathological cases

• Also realism is not necessarily as appealing as artistic interpretation

Page 65: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Animation RecapMost common pipeline:• build a 3D model of the character• rig the 3D model (build a skeleton

inside)• skin the model (determine bone-skin

weights)• animate the bones by specifying

keyframes; skin moves with them

Page 66: Character Animation and Skinningtheshark/courses/cs354/... · 2018-10-22 · Other 3D Animation Techniques SCAPE: data-driven statistical model of human body shapes rig a “mean”

Animation Recap

Most common pipeline:• model, rig, skin, animate

Automatic approaches exist for each step• not great, but getting better

Still a grand challenge: use Kinect to build a fully rigged and skinned digital avatar