Skip to content
/ birds Public

Clojure implementation of the Boids algorithm using quil for visualizations

License

Notifications You must be signed in to change notification settings

worace/birds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

birds

Example implementation of Craig Reynolds' Boids automata algorithm in Clojure using the Quil library as an interface to Processing.

Rules for Boids:

  1. Birds attempt to avoid collisions with flockmates by steering away from neighbors average position when too close.
  2. Birds attempt to follow a shared trajectory by steering toward the average heading of their neighbors.
  3. Birds attempt to "flock" together by steering toward the average position of their neighbors.

Other topics to explore:

  • Obstacle avoidance?
  • Goal-seeking? (steer toward mouse or some other defined objective?)

Issues

  • Rotation -- current heading rotation implementation has issues with turning in the optimal direction (i.e. turning right 30 degrees instead of left 330 degrees to reach the same heading). This produces some jumpy behavior sometimes.
  • Pretty-fi the rendering -- would be cool to get some nicer colors/design/shapes into the Rendering
  • ClojureScript/processing JS -- my eventual goal is to compile all this down into clojurescript and expose it on the web somehow

sample

A sample video of what the algorithm looks like so far can be seenhere: https://vimeo.com/126003095.

Usage

Should be able to run from the project root with

lein deps
lein run

About

Clojure implementation of the Boids algorithm using quil for visualizations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published