Click here to the see the visualization
Basic idea and behavior rules
I’ve been interested in emergent behavior since early college. One of the first algorithms I learned for emergent behavior was the Boid flocking algorithm, created by Craig Reynolds in 1986. I’ve always wanted to model this, but I never had any experience in 3d programming until very recently.
The idea behind the boid algorithm (and emergent behavior in general) is complex behavior arises from fairly simple interaction rules. For this implementation, I applied the following behavior rules to each of the boids (dots):
- Move toward the center of the mass of the swarm
- Avoid other boids
- Try to match velocities with other boids
- Stay within bounds (I just used a cube for this)
Descriptions of these rules and pseudocode to implement it can be found here: http://www.vergenet.net/~conrad/boids/pseudocode.html
Adding more dimensions
At my 9-5 I’ve been thinking a lot about how to represent multidimensional data. I realized the boid behaviors could be easily extended into multiple dimensions if the other dimensions provided good visual cues. I decided to go with three different 3 dimensional spaces, with each axis a continuous numerical value that could be translated into a visual construct. The 3D graphs always map the positional locations of the boids, but the 10D graph only pulls the positional elements from the XYZ space. The following images show the max/min of all the axes.
First 3d space: positional X, Y, and Z

Positional X, Y, and Z
This works exactly as you would imagine. The coordinates here are simply the 3d positions you’re used to dealing with.
Second 3d space: Red, Green, and Blue

RGB Space
For RGB space, X represents the amount of red in the color (0-255), Y represents the amount of green in the color (0-255), and Z represents the amount of blue in the color (0-255).
Third 3d space: alpha, size, and number of shape vertices

Alpha, Size, and Vertices Space
For this space, I used alpha (transparency) for the x value. You can see the boid on the left is completely black while the one on the right (the minimum negative x value) is faded out. The y axis scales the size of the boid. The z axis determines the number of vertices the node shape has (from 3 – 6). You can see the minimum z value has a vertex count of 3 (triangle), while the max z almost looks circular (hexagon).
For this example, I’m running 3 separate boid algorithms on each of the spaces and then combining the output into one 9 dimensional space. The tenth dimension is time.

- Combined dimensions
To see it all in action, click here.
View sourcehas been enabled.