Skip to content

AbhikKhan/boid.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is Craig Reynolds' Flocking simulation algorithm, implemented with JavaScript. The simulated objects (boids) have three property

  • Separation: Each boids attempts to maintain a resonable amount of distance between itself and any nearby boids to prevent overcrowding.
  • Allignment: Boids try to change their position so that it corresponds with the average alignment of other nearby boids.
  • Cohesion: Every boid attempts to move towards the average position of other nearby boids.

The algorithm is further optimized using the **Quad Tree** data structure.
At each iteration the boids are inserted into the quadtree and each boid get to know about their neighbor using the quadtree in O(log(n)) time.
To see the simulation Click here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published