Some tests with boids and flocking

Here is something I’ve been playing with lately. It has been done before and it’s nothing fancy, – I enjoyed tinkering with it nonetheless :) Everything was written in C++ using openFrameworks.

I implemented some basic flocking with simple obstacle-avoiding and use it to create images from the boids’ movements. The forces that control the boids are the three classic ones from the system invented by Craig Reynolds. Namely, the forces are separation, alignment and cohesion. If you want to know more, read up on how it works here:

Here is a video of the movement. You can watch it in HD on vimeo.

The resulting image looks like this. For this, I start with a black background and add colors to the pixels that the boids visit, – if a pixel is hit multiple times, it gets brighter.

Here is an alternative. I use colorpalettes and when a boid visits a pixel, that pixel gets colored by the boid’s color. Click to enlarge:

I really like watching these little buggers. If you are like me, you can have a look at the following video. These are the processes that have resulted in the images shown above.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s