physical based animation/simulation

51
Physical Based Animation/Simulation

Upload: landen

Post on 14-Jan-2016

55 views

Category:

Documents


0 download

DESCRIPTION

Physical Based Animation/Simulation. Particle Systems. Particle systems offer a solution to modeling amorphous, dynamic and fluid objects like clouds, smoke, water, explosions and fire. Representing Objects with Particles. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Physical Based Animation/Simulation

Physical Based Animation/Simulation

Page 2: Physical Based Animation/Simulation

Particle Systems

Particle systems offer a solution to modeling amorphous, dynamic and fluid objects like clouds, smoke, water, explosions and fire.

Page 3: Physical Based Animation/Simulation

Representing Objects with Particles

• An object is represented as clouds of primitive particles that define its volume rather than by polygons or patches that define its boundary.

• A particle system is dynamic, particles changing form and moving with the passage of time.

• Object is not deterministic, its shape and form are not completely specified. Instead

Page 4: Physical Based Animation/Simulation

Basic Model of Particle Systems

1) New particles are generated into the system.2) Each new particle is assigned its individual

attributes.3) Any particles that have existed past their

prescribed lifetime are extinguished.4) The remaining particles are moved and

transformed according to their dynamic attributes.

5) An image of the particles is rendered in the frame buffer, often using special purpose algorithms.

Page 5: Physical Based Animation/Simulation

Particle Attributes

• Initial position• Initial velocity• Initial size

– InitialSize = MeanSize + Rand() X VarSize

• Initial color• Initial transparency• Shape• Lifetime

Alias|Wavefront’s Maya

Page 6: Physical Based Animation/Simulation

Particle Dynamics

A particle’s position is found by simply adding its velocity vector to its position vector. This can be modified by forces such as gravity.

Other attributes can Other attributes can vary over time as vary over time as well, such as color, well, such as color, transparency and transparency and size. These rates of size. These rates of change can be global change can be global or they can be or they can be stochastic for each stochastic for each particle. particle.

Page 7: Physical Based Animation/Simulation

Particle Extinction

• When generated, given a lifetime in frames.

• Lifetime decremented each frame, particle is killed when it reaches zero.

• Kill particles that no longer contribute to image (transparency below a certain threshold, etc.).

Page 8: Physical Based Animation/Simulation

Particle Rendering

• Particles can obscure other objects behind them, can be transparent, and can cast shadows on other objects. The objects may be polygons, curved surfaces, or other particles.

Page 9: Physical Based Animation/Simulation

Star Trek II: The Wrath of Khan

Page 10: Physical Based Animation/Simulation

Particle Hierarchy

Particle system such that particles can themselves be particle systems.

The child particle systems can inherit the properties of the parents.

Page 11: Physical Based Animation/Simulation

Grass

• Entire trajectory of a particle over its lifespan is rendered to produce a static image.

• Green and dark green colors assigned to the particles which are shaded on the basis of the scene’s light sources.

• Each particle becomes a blade of grass.

white.sand by Alvy Ray Smith(he was also working at Lucasfilm)

Page 12: Physical Based Animation/Simulation

Soft Bodies

• Particle system deforms the surface of a NURBS or polygonal object.

chewing gum soft body

Page 13: Physical Based Animation/Simulation

Physical Based Animation/Simulation

Page 14: Physical Based Animation/Simulation
Page 15: Physical Based Animation/Simulation

Flocking• Schooling or swarming or herding• Relate to groups of characters• Craig W. Reynolds, “Flocks, herds and schools: A distributed

behavioral model”, SIGGRAPH 87

• Three simple rules (steering behavior):

– Separation, Alignment, Cohesion

– Together gives groups of autonomous agents (boids) a realistic form of group behavior similar to flocks of birds, schools of fish, or swarms of bees. ex1, ex2

– The steering behavior determines how a character reacts to other characters in its local neighborhood.

Birds plus -oids

Page 16: Physical Based Animation/Simulation

Emergent Behaviors

• Combination of three flocking rules results in emergence of fluid group movements

• Emergent behavior– Behaviors that aren’t explicitly programmed

into individual agent rules• Ants, bees, schooling fishes

Page 17: Physical Based Animation/Simulation

Three Rules (Steering Behaviors)

1. Separation: steer to avoid crowding local flockmates

2. Alignment: steer toward the average heading of local flockmates

3. Cohesion: steer to move toward the average position of local flockmates

Page 18: Physical Based Animation/Simulation

Three Rules (Steering Behaviors)

• In each rule, the steering behavior determines how a character reacts to other characters in its local neighborhood.

• Characters outside of the local neighborhood are ignored.

• The neighborhood is specified by a distance which defines when two characters are “nearby”, and an angle which defines the character’s perceptual “field of view.”

Page 19: Physical Based Animation/Simulation

Separationsteer to avoid crowding local flockmates

Gives a character the ability to maintain a certain separation distance from others nearby.

Page 20: Physical Based Animation/Simulation

How to Compute Steering for Separation?

• First a search is made to find other characters within the specified neighborhood (exhaustive, spatial partitioning, caching scheme)

• For each nearby character, a repulsive force is computed by subtracting the positions of our character and the nearby character, normalizing, and then applying a 1/r weighting. (That is, the position offset vector is scaled by 1/r 2.)

• These repulsive forces for each nearby character are summed together to produce the overall steering force.

Page 21: Physical Based Animation/Simulation

Alignmentsteer toward the average heading of local flockmates

Gives an character the ability to align itself with (that is, head in the same direction and/or speed as) other nearby characters

Page 22: Physical Based Animation/Simulation

How to Compute Steering for Alignment?

• Find all characters in the local neighborhood (as described for separation)

• Average together the velocity (or alternately, the unit forward vector) of the nearby characters.

• This average is the “desired velocity,” and so the steering vector is the difference between the average and our character’s current velocity (or alternately, its unit forward vector).

• This steering will tend to turn our character so it is aligned with its neighbors.

Page 23: Physical Based Animation/Simulation

Cohesionsteer to move toward the average position of local flockmates

Gives an character the ability to cohere with (approach and form a group with) other nearby characters

Page 24: Physical Based Animation/Simulation

How to Compute Steering for Cohesion?

• Find all characters in the local neighborhood (as described for separation)

• Computing the “average position” (or “center of gravity”) of the nearby characters.

• The steering force can applied in the direction of that “average position” (subtracting our character position from the average position, as in the original boids model), or it can be used as the target for seek steering behavior.

Page 25: Physical Based Animation/Simulation

Separation, Alignment and Cohesion

• In some applications it is sufficient to simply sum up the three steering force vectors to produce a single combined steering for flocking

• However for better control it is helpful to:1. normalize the three steering components2. scale them by three weighting factors before summing them.

• As a result, boid flocking behavior is specified by nine numerical parameters:

– a weight (for combining), – a distance and an angle (to define the neighborhood) for each of the three component behaviors.

Page 26: Physical Based Animation/Simulation

Combined Behaviors and Groups

• Flocking (combining: separation, alignment, cohesion)

• Crowd Path Following

• Leader Following

• Unaligned Collision Avoidance • Queuing

(at a doorway)

Page 27: Physical Based Animation/Simulation

Physical Based Animation/Simulation

Page 28: Physical Based Animation/Simulation

Cognitive Modeling

Use AI to allow for planning and learning

Page 29: Physical Based Animation/Simulation

Control Algorithms

Simplified control loop

Use feedback to maintain: balance velocity (speed and direction) etc.

User Control Simulation

Frame

Page 30: Physical Based Animation/Simulation

State Machines

Separate the motion or behavior into several simple states

State transitions are triggered by events

Example: fall forward until foot hits the ground

Simple states allow us to generate laws

Page 31: Physical Based Animation/Simulation

Running State Machine

Page 32: Physical Based Animation/Simulation

Overview

• Virtual Creatures

• Creature Representation

• Creature Control

• Physical Simulation

• Behavior

• Evolution

• Results

Page 33: Physical Based Animation/Simulation

Virtual Creatures

• Complexity vs. Control

• Genetic Algorithms– Darwin (fitness)– Differs from previous work

Page 34: Physical Based Animation/Simulation

Creature Representation

• Genotype • Phenotype

Page 35: Physical Based Animation/Simulation

Creature Representation

• Directed Graph– Nodes

• Information– Dimensions

– Joint-type

– Joint-limits

– Recursive-limit

– Neurons

– Connections

» Child Node

» Position

» Orientation

Page 36: Physical Based Animation/Simulation

Creature Control

• Brain– A directed graph of “neurons”

• Effectors– Applied at Joints as Forces or Torques

• Muscle Pairs

Page 37: Physical Based Animation/Simulation

Creature Control

• Neurons– Provide different functions

• Sum, product, abs, max, sin, cos, oscillators, etc…

– Output vs. Input• Number of inputs dependant on function• Output dependant on input and maybe previous

state

Page 38: Physical Based Animation/Simulation

Combining Control and Representation

Page 39: Physical Based Animation/Simulation

Physical Simulation

• Collision Detection– Bounding Box + Pair Specific

• Collision Response– Impulses + penalty springs

• Friction

• Viscosity– For simulating underwater

Page 40: Physical Based Animation/Simulation

Behavior

• Evolution for a specific behavior– Swimming– Walking– Jumping– Following (Land/Water)

• Fitness function evaluated at each step– Weights for more preferred methods

Page 41: Physical Based Animation/Simulation

Evolution

• Recipe for a successful evolution1. Create initial genotypes

1. From scratch

2. Calculate survival ratio

3. Evaluate fitness and kill off the weaklings

4. Reproduce the most fit

5. Evolve, and proceed to step 3.

Page 42: Physical Based Animation/Simulation

EvolutionMating: CrossOver & Mutation

• Reproductive Method– 40% Asexual– 30% Crossover– 30% Grafting

Page 43: Physical Based Animation/Simulation

Performance

• CM-5 with 32 processors – 3 Hours– Population of 300– 100 Generations

Page 44: Physical Based Animation/Simulation

Results

• Homogeneity• Swimmers

– Paddlers– Tail-waggers

• Walkers– Lizard-like– Pushers/Pullers– Hoppers

• Followers– Steering Fins– Paddlers

Page 45: Physical Based Animation/Simulation

Overview of vBeluga

• Virtual belugas are shown in a wild pod context• Incorporates research on beluga behavior and vocalization

conducted at aquarium UBC Zoology• Flow: scientist – game – visitors : wild belugas : captive -

wild• Simulation : AI architecture - belugas can learn and alter

their behavior based on changes in their environment – updatable: new scientific thinking

• Physically-based system allows for natural whale locomotion and realistic water – game research

• Realistic graphics : use of actuators (virtual bones and muscles) - game research

Page 46: Physical Based Animation/Simulation

Beluga Behavior SystemNNet, Action Selection

DiPaola,Akai,Kraus 06 "Experiencing Belugas: Developing an Action Selection-Based Aquarium Interactive", Journal of Adaptive Behavior Foundation AI (NSERC)DiPaola,Akai 06 “Designing Adaptive Multimedia Interactives to Support Shared Learning Experiences", ACM Siggraph Education Design HCI / Informal Learning (SAGE)DiPaola,Akai 06 "Blending Science Knowledge and AI Gaming Techniques for Experiential Learning", CA Game Studies Assoc. Gaming/LearningDiPaola,Akai 05 “Shifting Boundaries: the Ontological Implications of Simulating Marine Mammals”, NewForms, Museum of Anthropology IT/Society

Page 47: Physical Based Animation/Simulation

Vancouver Aquarium: Adv. Layer

Page 48: Physical Based Animation/Simulation

Neural Net Layer

Page 49: Physical Based Animation/Simulation

Flexibility of use

• Decouple Display with UI (tabletop)– Control crowd by related placement

• Main gallery full ui: tabletop, projection, signage• Summer camp simple ui: on every system• Beluga encounters guided system• Corporate gathering main system, ambient mode

Page 50: Physical Based Animation/Simulation
Page 51: Physical Based Animation/Simulation

Physical Based Animation/Simulation