
Boids
For an engineering computing final project, I recreated Craig Reynolds' Boids program in MATLAB. Read more about it here:
Boids is an "artificial life" program. Each boid independently determines its own position relative to nearby boids, similar to real-life birds, fish, and herd animals like sheep. Despite the relatively simple rules, this leads to fantastically lifelike and unpredictable movements of "flocks" of boids. I created versions for 2D and 3D.
This program was developed for use in realistic CGI but has since seen use in swarm robotics. It was great practice with MATLAB and also vector calculus, which is the basis of how the boids adjust their positions.


More recently, I’ve rewritten this script for a different purpose. If each frame of the animation is saved and then segmented as if they were CT imagery, very interesting geometries can be created. The boids can be controlled in a variety of ways, i.e. in relation to each other, as a function of their absolute coordinates, or as a function of time. By altering their “personal space” vector over time, the boids can be induced to diverge and then converge to create a sort of tree/capillary/heat exchange geometry.

Imagine time is the X-axis here.

And here is the 2D animation that produced the structure.