Behavioral Animation Simulation of Flocking Birds Autonomous characters determine their actions Simulating the paths of individuals in: flocks of birds, schools of fish, herds of animals crowd scenes 1. Physics of Flight 2. Boids: Geometric Flight, Simulated Perception 3. Flocking Behaviour 4. Avoiding Obstacles
Physics of Flight (simple) Flight: movement through air (fluid) Air is a fluid: the force to deform it depends on how fast it is deformed, not how much. Heavier-than-air flight subject to 4 forces: drag weight thrust lift http://www.ucmp.berkeley.edu/vertebrates/flight/physics.html
Physics of Flight Drag (d): in the direction of relative fluid flow (relative wind) approximately opposite to the flight path Weight (w): due to gravity perceived weight due to other accelerations Thrust (t): powered flight force (wing flapping) Lift (l): generally upwards, perpendicular to drag At a steady horizontal flight: t t = v v ; t = d ; l = w http://www.aeromuseum.org/articles/dec04/simpleaerodynamicspartone.htm
Physics of Flight: Drag drag force limits speed d = C d ( 1 2 ρv2 )S d [ kgm ]... drag force s 2 C d [1]... drag coefficient (shape, surface friction ρ [ kg ]... fluid density 3 v [ m]... speed s S [m 2 ]... cross-section area aerodynamic shape and material minimize drag http://web.mit.edu/16.00/www/aec/flight.html
Physics of Flight: Lift lift keeps the flyer airborne; counters gravity l = C l ( 1 2 ρv2 )A l [ kgm ]... lift force s 2 C l [1]... lift coefficient (wing construction... ) ρ [ kg ]... fluid density 3 v [ m]... speed s A [m 2 ]... wing area
Physics of Flight: Thrust powered flight force a t = t m t [ kgm ]... thrust force s 2 a t [ m ]... acceleration due to thrust s 2 m [kg]... mass http://web.mit.edu/16.00/www/aec/flight.html
Physics of Flight: Weight due to gravity w = mg w [ kgm ]... weight force s 2 g [ m ]... gee (gravity) s 2 m [kg]... mass flyers minimize weight
Physics of Flight: Weight descend: t = d-c (when not accelerating) no need for power (gliders) climb: t = d+c needs more power
Physics of Flight: Perceived Weight increase of weight in turns, or accelerated entries to climbs more lift needed in a turn; can climb less in a turn
Geometric Flight Geometric flight: the animated motion of a flyer along a path; the result of incremental translations forward and steering; increment rate >= frame rate Flight control: thrust (wing flapping): speed pitch: altitude, up/down roll (bank): direction, left/right no explicit yaw Fly to goal: if the situation permits, steer in the direction of a scripted goal (DEMO)
Boids: Flocking Behaviour Craig Reynolds (1986): a computer model of coordinated animal motion; boid: bird-oid, a bird-like flying object Start with a boid capable of geometric flight; add simulated perception, follow three "environmental urges": separation: steer to avoid local crowding alignment: match the headings of local flockmates (steer in the same direction) (velocity matching: attempt to match the velocity of local flockmates) cohesion: move towards the avg. position of flockmates images: http://we
Flocking Algorithm Separation: us = c s nbr d s d 2 Alignment: Cohesion: u v = c v nbr u c = c c nbr s h nbr s d u... urge vector c s, c v, c c... parameters (constants) nbr... neighbour s... sensitivity function images: http://we
Flocking Algorithm Sensitivity function: models limited perception s = a p a = d h + 1 p = f( d ); 0 p 1, e.g. p = max(0, 1 d r ) s... sensitivity function a... factor dependent on angle p... distance factor r... perception radius http://citeseer.ist.psu.edu/schnapauff98simulating.html
Obstacle Avoidance Directing the paths of objects moving in an environment to avoid collisions with (static) objects; steer clear of obstacles, away from an imminent impact Techniques: simulated forces steer away from the surface steer away from the centre steer along the surface steer towards a silhouette edge http://web.red3d.com/cwr/nobump/nobump.html
Obstacle Avoidance Steer away from the surface: http://web.red3d.com/cwr/nobump/nobump.html
Obstacle Avoidance Steer away away from the centre: spherical force field http://web.red3d.com/cwr/nobump/nobump.html
Obstacle Avoidance Steer along the surface (curb feeler): http://web.red3d.com/cwr/nobump/nobump.html
Obstacle Avoidance Steer towards a silhouette edge: spiral search http://web.red3d.com/cwr/nobump/nobump.html
Finding Parameters Tuning of parameters and rules produces various behaviours starting point = physical reality trial/error evolutionary techniques (DEMO)