Java Boids

You need to be using an Java-enabled browser to see this demo.

This is a demonstration of the boids model of bird flocking (and related group motion) written as a Java applet. For additional background information, see the boids page.

The boids are modeled as point masses. A local 3D coordinate system (frame of reference) is attached to the point mass and made to align with its velocity. Based on its local environment, each boid's behavioral controller computes a steering force on each iteration of the simulation. The steering force and velocity are clipped if they exceed a certain threshold. In this demo the boids are contained inside a wrap-around sphere. When they venture outside of the sphere they are "teleported" to the opposite side of the sphere. Note that aside from randomized initial positions for the boids, this simulation is entirely deterministic. All the lifelike, unpredictable behavior emerges from the complex adaptive nature of the model.

This applet was created using the Cosmo Code 2.0 Java development environment. The 3D rendering is accomplished using a slightly modified version of a class implemented by Paul Haeberli for his Pure Java 3d applet. (BTW: Paul suggested that I point out that my applet ignores mouse input.) In the future I hope to provide a version that allows you to interactively adjust various parameters of the simulation. Thanks also to Xiaoyuan Tu and Roy Hashimoto who made significant contributions to an earlier C++ version of this demo.


Other boids-related applets

See also Applets for Neural Networks and Artificial Life by Akio Utsugi

Mac users: for better Java support, try the iCab browser.


Send comments to Craig Reynolds <cwr@red3d.com>
visitors since September 24, 1996
Last update: December 7, 2000