25
CS 231 Procedural Animation CS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation

CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

  • Upload
    others

  • View
    19

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

1

CS 231

Procedural Animation

CS 231

Procedural Animation

Procedural Animation

Rule based animation

Particle systems

Free-form deformation

Page 2: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

2

Procedural Animation

Rule based animation that changes/evolves over time.

Types of procedural systems:Function-based

Animating with noise

Grammars and fractals

Procedural Animation

Function-basedAnimating with mathematical rules

sine, cos, exp, ln, etc.Often depends on geometryPlay with this in MEL!

Page 3: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

3

Procedural Animation

Animation example with kinematics

Procedural motionHip, knee, ankle

Rules turn on and offprescribed curves(scaled sin,cos) tocreate walk cycle

Animating with noise()

Perlin 1985 “invents” noise

What is noise()?

A 'random' function that has statisticalproperties perceived by the human visual system to include 'appropriate' detail at a variety of scales.

Page 4: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

4

Animating with noise()Character animation a la Perlin

Use noise and sinusoid functions tocreate layerable, life-like animations

Behaviors built from low-level actions

Layered and transitions allow directablemotions

Animating with noise()Results:

Page 5: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

5

Animating with noise()Character actions

A1 = Shoulder ( sin(t) 0 sin(t) )...Hip ( noise(t) 0 noise(t) )

A2 = Shoulder ( 0 0 noise(t) )...Hip (sin(t) sin(t) sin(t) )

Animating with noise()

Noise adds lifelike feel to models and movement

Powerful tool in layering and combining

Must model constraints explicitly

Animators skill play a heavy hand in success

Page 6: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

6

Animating with noise()Results:

Particle systemsAnimating complicated systems withmany small elements and simple rules

Very common method for doing many effects: water spray, explosions, fireworks

Rules can include:Distribution rateMovementColor, size, shapeLife span, age-related changes

Page 7: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

7

Particle systemsMoving particles

(X, V)

Particle dynamics

Newtonian particles: f = m a a = dv/dt = d2x/dt2

Given f, find the position x so we integrate

Can use a simple approximation:

vt+1 = at ∆t + vtxt+1 = vt ∆t + xt

Accuracy is not as important as effect!

Page 8: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

8

Particle systems

for each video frame{

generate new particles;remove old particles;for each particle

{ resolve forces by vector addition;calculate a, v, x;apply rendering;

}}

“Wrath of Khan” – the first particle effects in film

Many particle systems starting at different times to simulate the flames spreading

In total around 750,000 particles

Page 9: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

9

“Wrath of Khan” – the first particle effects in film

“Wrath of Khan” – the first particle effects in film

Page 10: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

10

Particle systems – Movement

Applying an (force) acceleration to the particles acceleration types include:

Random accelerations Acceleration toward/away from a point Acceleration toward/away from a line Spirals, Vortices, Tornadoes

Particles move in a coherent fashionto produce overall effect

Other prescribed motions (sin(t), etc.)

Bouncing off a plane or other surface

Collision detection and collision resolution.Damping during collision, other richer behavior.

A plane is an easy surface with which to collide:if (z < o) velocity_z = -1*coef_restitution

Simple water-like effects can be created from particles bouncing off of objects.

Particle systems – Collision

Page 11: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

11

Particle systems – Rigging to kinematic model

Starting from particle,"rig" follows

Procedurally add walkcycle based on

velocityturning radius

May use IK

Particle systems – Rigging to kinematic model

Page 12: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

12

Particle systems – Results

Very fast – many particles

Often in realtime (games)

Large range of effects

Not great for highly ordered motionsor complex objects

Free-form deformationEmbed an object in a deformable region of

space.Each point of the object has a unique

parameterization that defines its position in the region.

When the region is altered, causing recalculation of each points’ new positions based upon their initial parameterization.

Page 13: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

13

What is “Free-Form” ?

Parametric surfaces are free-form surfaces.The flexibility in this technique of deformation

allows us deform the model in a free-form manner.

Introduction Deformation of the lattice then implicitly

defines a deformation of the space.Track positions of key points within the

deformed sequence of lattices.

Page 14: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

14

- Compressive bulging (e.g. muscles)- Folding and stretching (e.g. skin)- Draping

Physical Phenomena

Contortion for Expression- Anthropomorphic form (e.g. Aladdin’s carpet)- Facial gestures

Introduction

Skeletal Deformation

Page 15: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

15

Interior angle bisectorsPerpendiculars at end points

Skeletal Deformation

d

L

s

Get object

Draw polyline

Map vertices to polyline

Warp polyline

Reposition verticesto polyline

Skeletal Deformation

Page 16: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

16

Skeletal Deformation

Grid Deformation

Overlay 2D grid on top of object

Map object vertices to grid cells (create local coordinate system)

User distorts 2D grid vertices

Object vertices are remapped to local coordinate system of 2D grid by using bilinear interpolation

Page 17: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

17

Grid Deformation

0.5

0.8

For each vertexIdentify cellLocal u,v coorindate

Grid Deformation

Page 18: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

18

Bilinear interpolationPu0 = (1-u)*P00 + u*P10Pu1 = (1-u)*P01 + u*P11Puv = (1-v)*P0u + v*P1u

P00

P01

P01

P11

Pu0

Pu1

Grid Deformation

Grid Deformation

Page 19: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

19

Grid Deformation

Free-Form Deformations

(not necessarily mutually perpendicular)S

T

U

Define local coordinate system for deformation

Page 20: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

20

FFD - register point in cell

S

T

U

s = (TxU) . (P-P0) / ((TxU) . S)

TxU U

S

T

P

P0

((TxU) . S)(TxU) . (P-P0)

P = P0 + sS + tT + uU

FFD - register point in cell

Page 21: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

21

(not necessarily mutually perpendicular)

FFD - register point in cell

FFD - move and reposition

Move control grid points

Usually tri-cubic interpolation is used with FFDs

Originally Bezier interpolation was used.

B-spline and Catmull-Romm interpolation have also been used (as well as tri-linear interpolation)

Page 22: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

22

Example of FFD

It is originally a cylinder. Red boundary is FFD block embedded with that cylinder

Move control points of each end,and you can see cylinder inside also changes.

Move inner control points downwards

Final shaded version

Page 23: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

23

Examples

Hierarchical FFD

The original lattice is deformed by moving one or more of its vertices.

The deformed lattice is then refined n times.Each point is used to obtain the corresponding cell.Calculate position for each deformed point according to the parameters associated with the original cell.

Page 24: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

24

Hierarchical FFD

Result (1/3)

Deform a disk with a star-shaped lattice.

Page 25: CS 231 Procedural Animation - UCRvbz/cs231s09/lecture7-09.pdfCS 231 Procedural Animation Procedural Animation Rule based animation Particle systems Free-form deformation. 2 ... Particles

25

Result(2/3)

Result(3/3)

Deform a monster’s arm