38
ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES Rémi Ronfard, Animation, M2R IICAO

ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

  • Upload
    dodien

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

ANIMATION 4 : MODELES

PHYSIQUES ET DYNAMIQUES

Rémi Ronfard, Animation, M2R IICAO

Page 2: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Plan du cours

Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning).

TP : programmation d’un rig dans Blender

Cours 2: Animation par keyframes + techniques d’interpolation

TP : animation par keyframes dans Blender

Cours 3: Cinématique inverse

TP : animation d’une marche dans Blender

Cours 4: Animation physique

TP: animation d’un ragdoll dans Blender

Page 3: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Summary of physics-based animation

Motivation

Newton’s Laws

Point-mass models

Rigid and articulated bodies

Ragdolls

Uncanny Valley

Page 4: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Cartoon physics vs. Real world physics

Any body suspended in space will remain in space until made aware of its situation.

Any body in motion will tend to remain in motion until solid matter intervenes suddenly.

Any body passing through solid matter will leave a perforation conforming to its perimeter.

The time required for an object to fall twenty stories is greater than or equal to the time it takes for whoever knocked it off the ledge to spiral down twenty flights to attempt to capture it unbroken.

Certain bodies can pass through solid walls painted to resemble tunnel entrances; others cannot.

Page 5: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Motivation : useful motor skills

Page 6: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Motivation : Animation physique dans Blender

Game Engine : Sensors, Controllers and Actuators

Bullet Physics

Ragdolls

Page 7: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

De la cinématique à la dynamique

Calcul des positions, vitesses, angles et vitesses angulaires en fonction du temps

Intégration à partir des équations du mouvement

Page 8: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Principaux concepts en dynamique

Forces

Centres de masse et

inerties

Page 9: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Newton’s Law and Euler integration

Euler method, named after Leonhard Euler, is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value.

It is the most basic kind of explicit method for numerical integration of ordinary differential equations.

Start at x0

Compute acceleration

from f = ma (Newton)

Update velocity and

position

Page 10: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Midpoint and second order methods

Page 11: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Verlet integration

Verlet integration was used by Carl Størmer to compute the trajectories of particles moving in a magnetic field (hence it is also called Störmer's method) and was popularized in molecular dynamics by French physicist Loup Verlet in 1967.

It is frequently used to calculate trajectories of particles in molecular dynamics simulations and video games.

At first it may seem natural to simply calculate trajectories using Euler integration. However, this kind of integration suffers from many problems

Stability of the technique depends fairly heavily upon either a uniform update rate, or the ability to accurately identify positions at a small time delta into the past.

Page 12: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Verlet integration

Remember previous

position x*

Current position is x

Update x and x*

Advantage : velocity

cannot go wrong !

Applications to

particle systems, mass-

spring models, rigd

and soft bodies

Page 13: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Mass spring models (1)

Page 14: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Mass-spring models (2)

Page 15: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Mass spring models (3)

Page 16: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Mass-spring models (4)

Page 17: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Mass spring models (5)

Page 18: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Mass spring models (6)

Page 19: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Collision and contact

Realistic forces include collision and contact

Springs at contact point

Collision detection

Collision backtracking

Page 20: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Bullet Collision Detection & Physics

Library by Erwin Coumans

Rigid body and soft body simulation with discrete and

continuous collision detection

Collision shapes include: sphere, box, cylinder, cone,

convex hull using GJK, non-convex and triangle mesh

A rich set of rigid body and soft body constraints with

constraint limits and motors

Soft body support: cloth, rope and deformable objects

Page 21: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Rigid and articulated bodies

Forward dynamics

from joint (muscle) forces to joint trajectories (positions, velocities, accelerations)

Useful for animation and simulation

Inverse dynamics

from joint trajectories (positions, velocities, accelerations) to joint (muscle) forces

Useful for motion capture and control

Page 22: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Direct dynamics : Newton-Euler

Combine Newton and Euler equations of motion

Linear acceleration

Angular acceleration

As a result of direct forces on the joint

Other forces

And inertia matrix

Page 23: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Moments of inertia

Kinetic energy of a solid rotating

around axis N with angular velocity

Moment of inertia

ω

Page 24: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Inverse dynamics : articulated body algorithm

Each body in an articulated chain has

acceleration

Forces can be computed as

With and

Page 25: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Ragdoll physics =« lifelike death »

In computer physics engines, ragdoll physics is a type of procedural animation that is often used as a replacement for traditional static death animations.

The term ragdoll comes from the problem that the articulated systems, due to the limits of the solvers used, tend to have little or zero joint/skeletal muscle stiffness, leading to a character collapsing much like a toy rag doll, often into comically improbable or compromising positions.

Page 26: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Ragdoll physics

Dead bodies -> all physics, no muscles

Ragdolls have been implemented using

Featherstone's algorithm and spring-damper

contacts.[2]

An alternative approach uses constraint solvers and

idealized contacts.[3]

Page 27: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Procedural animation of ragdolls

traditionally used in non-realtime media (film/TV/etc), this technique (used in the Medal of Honor series starting from European Assaultonward) employs the use of multi-layered physical models in non-playing characters (bones / muscle / nervous systems), and deformable scenic elements from "simulated materials" in vehicles, etc.

By removing the use of pre-made animation, each reaction seen by the player is unique, whilst still deterministic. Rather than detract from gameplay through overstimulation, the "natural" qualities of movement provide for a more immersive experience, and extended replayability.

Page 28: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Featherstone's algorithm

Featherstone's algorithm is a technique used for computing the effects of forces applied to a structure of joints and links (an "open kinematic chain") such as a skeleton used in ragdoll physics.

The Featherstone's algorithm uses a reduced coordinate representation. This is in contrast to the more popular Lagrange multiplier method, which uses maximal coordinates. Brian Mirtich'sPhD Thesis has a very clear and detailed description of the algorithm. Baraff's paper "Linear-time dynamics using Lagrange multipliers" has a discussion and comparison of both algorithms.

Featherstone, R. (1987). Robot Dynamics Algorithms

Page 29: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Other rag doll techniques

While the constrained-rigid-body approach to ragdolls is the most common, other "pseudo-ragdoll" techniques have been used:

Verlet integration: used by Hitman: Codename 47 and popularized by Thomas Jakobsen,[4]

Blended ragdoll: this technique was used in Halo 2, Call of Duty 4: Modern Warfare, Left 4 Dead, Medal of Honor: Airborne, and Uncharted: Drake's Fortune. It works by playing a pre-made animation, but constraining the output of that animation to what a physical system would allow.

Page 30: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

The future : Physics-based 3D character animation

Real-time Physics-based 3D Biped Character

Animation Using an Inverted Pendulum Model,

Page 31: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Generalized Biped Walking Control by Stelian

Coros, Philippe Beaudoin, Michiel van de Panne

Page 32: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Jacobians for velocity (left) and gravity (right)

Page 33: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Animation physique du corps

Dynamics much more

complex than kinematics

320 pairs = 640

"voluntary" skeletal

muscles in the human

body move the various

parts of the body.

Page 34: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Animation physique du visage

The challenge is enormous: The face's 44 muscles are capable of producing some 5,000 different expressions.

500 activating commands are arranged by facial feature. For the right brow there's Raised, Mad, Sad - 15 in all.

"If I watch his eyes, I see that they are not fastened in his head, serene like agate marbles. They are being created at each moment by what they look at."

"If we call transcendence the ability of the mind to pass beyond itself and all other things as well, to escape from itself that it may lose itself elsewhere; then to be a visible transcendence is the meaning of a face."

The Face, by Jean-Paul Sartre

Page 35: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Caution : Uncanny valley

The uncanny valley is a hypothesis regarding the field of robotics.

The theory holds that when robotsand other facsimiles of humans look and act almost like actual humans, it causes a response of revulsion among human observers.

The "valley" in question is a dip in a proposed graph of the positivity of human reaction as a function of a robot's lifelikeness.

Page 36: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Conclusion

Domaines de recherche actifs

Réutilisation de capture de mouvements

Apprentissage et généralisation à partir d’exemples

Autres applications

Soft-body physics

Skin deformation, Cloth and Hair simulation

Page 37: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Conclusion

Page 38: ANIMATION 4 : MODELES PHYSIQUES ET DYNAMIQUES filePlan du cours Cours 1: Armatures (squelettes) et attachement a la surface du corps (skinning). TP : programmation d’un rig dans

Pour aller plus loin

Physically-based modeling at PIXAR ! http://www.pixar.com/companyinfo/research/pbm2001/

Game Physics Engine Development, by Ian Millington, Morgan Kaufmann; 2 edition (August 6, 2010)

http://animationphysics.wordpress.com/