bird-flocking Tailwind Templates

Bird Flocking

Browser-based simulation demonstrating emergent flocking behavior, referred to as "boids", with group of agents (birds) following a set of simple rules, resulting in complex, life-like flock movement patterns, using HTML, CSS (with Tailwind CSS for styling), and JavaScript for the logic and rendering on an HTML Canvas.

Bird flocking

Browser-based simulation demonstrating emergent flocking behavior, referred to as "boids", with group of agents (birds) following a set of simple rules, resulting in complex, life-like flock movement patterns, using HTML, CSS (with Tailwind CSS for styling), and JavaScript for the logic and rendering on an HTML Canvas.

image

How to run

Open bird-flocking.html

Mechanisms

  1. Separation: Steer to avoid crowding local flockmates. Birds calculate a repulsive force away from neighbors that are within the avoidanceRadius. The closer a neighbor, the stronger the repulsive force.
  2. Alignment: Steer towards the average heading (velocity) of local flockmates. Birds try to match the direction of their neighbors.
  3. Cohesion: Steer to move toward the average position (center of mass) of local flockmates. Birds try to stay close to the group.

Top categories

Loading Svelte Themes