cs230 : computer graphicsshinar/courses/cs230-winter-2012/lecture12.pdf · rise of the planet of...

50
CS230 : Computer Graphics Lecture 12: Introduction to Animation Tamar Shinar Computer Science & Engineering UC Riverside

Upload: others

Post on 22-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

CS230 : Computer GraphicsLecture 12: Introduction to Animation

Tamar ShinarComputer Science & Engineering

UC Riverside

Page 2: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Types of animation

• keyframing

• rotoscoping

• stop motion

• procedural

• simulation

• motion capture

Page 3: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Performance capture

Lord of the Rings, 2001

Rise of the Planet of the Apes, 2011

Avatar, 2009Andy Serkis - Gollum, Lord of the Ringschallenges - resolution, occlusion,

Page 4: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Rachel Weinstein, Joey Teran and Ron Fedkiw

Rigid body simulation

Page 5: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Rachel Weinstein, Joey Teran and Ron Fedkiw

Rigid body simulation

Page 6: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

5N. Molino, Z. Bao, R. Fedkiw

Deformable object simulation

Page 7: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Selle et al., 2008

Page 8: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Facial animation

Page 9: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Facial animation

Page 10: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Fluid simulation

Page 11: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Fluid simulation

Page 12: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Control of virtual character

issues: control algorithms, interaction with environment

Page 13: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Control of virtual character

issues: control algorithms, interaction with environment

Page 14: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

rigid/deformable simulator in Pixar’s WALL-E

Page 15: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

rigid/deformable simulator in Pixar’s WALL-E

Page 16: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Crowd simulation

Treuille et al., 2006

- agent-based, model behavior- also, “global effects” - e.g., incompressibility- emergent phenomena

Page 17: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Artificial life

• plants - movement and growth

• evolving artificial life

virtual worlds, special effects, games

Page 18: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

history

Page 19: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Gertie the Dinosaur

link

191412 minuteshand drawnkeyframe animationregistrationcycling

Page 20: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Traditional animation

• Cels

• Multiplane camera

Wikimedia Commons

Sleeping Beauty, Disney, 1959

Page 21: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Realistic 3D animation

• Disney’s Tron, 1981

• Pixar’s Toy Story, 1995, first 3D feature

Page 22: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Performance Capture

• Final Fantasy 2001

• Lord of the Rings 2001

• Beowulf 2007

• Avatar, 2009

• Adventures of Tintin, 2011

Lord of the Rings, 2001

Page 23: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

animation principles

Page 24: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

- animation can bring even a flour sack to life- animations principles common to any type of animation

Page 25: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

12 principles of animation

1. Squash and stretch2. Anticipation3. Staging4. Straight ahead action and pose to pose5. Follow through and overlapping action6. Slow in and slow out7. Arcs8. Secondary action9. Timing10. Exaggeration11. Solid drawing12. Appeal

principles are related to the underlying physics of motiontiming: important information. ease in/ease out

Page 26: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Physics-based animation

• Many animation principles follow from underlying physics

• anticipation, follow through, secondary action, squash and stretch, ...

• Spacetime Constraints, Witkin and Kass 1988

Page 27: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Physics-based animation

• Many animation principles follow from underlying physics

• anticipation, follow through, secondary action, squash and stretch, ...

• Spacetime Constraints, Witkin and Kass 1988

Page 28: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

keyframe animation

Page 29: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Keyframe animation

• draw a series of poses

• fill in the frames in between (“inbetweening”)

• computer animation uses interpolation

http://anim.tmog.net

Page 30: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Keyframe character DOFs

3 translational DOFs

48 rotational DOFs

Each joint can have up to 3 DOFs

Page 31: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Interpolation of keyframes

linear interpolation spline interpolation

Straightforward to interpolate position but what about orientation?

Page 32: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

general rotations

Page 33: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

27

Rotation

X axis

Y axis

Z axis

The rows and columns are orthonormal

Page 34: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

28

Rotation about an arbitrary axis

Rotating about an axis by theta degrees

• Rotate about x to bring axis to xz plane• Rotate about y to align axis with z -axis• Rotate theta degrees about z• Unrotate about y, unrotate about x

• Can you determine the values of Rx and Ry?

M = Rx-1 Ry-1 Rz(θ) Ry Rx

Page 35: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

29

Composite Transformations

• Rotating about a fixed point- basic rotation alone will rotate about origin

but we want:

Page 36: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

30

Composite Transformations

• Rotating about a fixed point• Move fixed point (px,py,pz) to origin• Rotate by desired amount• Move fixed point back to original position

M = T(px, py, pz) Rz(θ) T(-px, -py, -pz)

Page 37: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Euler’s Rotation Theorem

Any displacement of a rigid body such that a point on the rigid body remains fixed, can be described as a rotation by some angle about some axis

Page 38: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

euler angles

Page 39: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

33

Euler Angles

• A general rotation is a combination of three elementary rotations: around the x-axis (x-roll) , around the y-axis (y-pitch) and around the z-axis (z-yaw).

Page 40: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Gimbal and Euler Angles

Wikimedia Commons

Z-X’-Z’’

Page 41: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Extrinsic vs. Intrinsic rotations

Wikimedia Commons

Page 42: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

36

Euler Angles and Rotation Matrices

Page 43: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations
Page 44: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

quaternions

Page 45: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations
Page 46: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Quaternions

• axis/angle representation

• interpolates smoothly

• easy to compose

<whiteboard>

Page 47: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Quaternion Interpolation

linear spherical linear“slerp”

linear: treat quaternions as 4-vectors, note non-uniform speedspherical linear: constant speed

Page 48: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

Higher order interpolation

• Bezier curve

• Shoemake, Animating rotation with quaternion curves, 1985

Page 49: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

43

Matrix form

Page 50: CS230 : Computer Graphicsshinar/courses/cs230-winter-2012/Lecture12.pdf · Rise of the Planet of the Apes, 2011 Avatar, 2009 Andy Serkis - Gollum, Lord of the Rings ... - animations

44

Rotations in Reality

• It’s easiest to express rotations in Euler angles or Axis/angle

• We can convert to/from any of these representations

• Choose the best representation for the task- input:Euler angles- interpolation: quaternions- composing rotations: quaternions, orientation matrix