Description
Introduction
This project simulates flocking behavior using boids. It demonstrates how individual agents interact with their neighbors to create cohesive group movement, mimicking natural phenomena like bird flocks or fish schools.
Implementation
This project uses a quadtree data structure to optimize the simulation of boid interactions. Each boid follows simple rules for alignment, cohesion, and separation, which are calculated based on nearby boids. The simulation is rendered using p5.js.
What I Learned
I learned about implementing and optimizing simulations using data structures like quadtrees. Additionally, I explored how simple rules can lead to complex emergent behaviors in simulations.
Instructions:
- • F: Show/Hide Frame
- • Mouse Click: Grab Birds
- • Spacebar: Debug
Flocking Birds
Related Content
Explore quadtrees further in my blog:
Understanding QuadtreesOr, view all blogs:
All Blogs