This video demonstrates how a boid simulation works in real time. The blue cube boid entities are meant to represent fish swimming in a confined volume. Within the school of fish are lurking predators, disguised as prey. On occasion the predators come out of their disguise and start hunting prey. Predator interaction creates interesting animation effects, which is convincingly similar to flocks, herds or schools observed in nature.
The simulation is quite simplistic, it uses linear motion and basic distance equations to enforce boundaries and to animate the fish. This of course introduces obvious artifacts, such as jerky animation, oscillations, and poor collision detection with external objects. You will notice that the aquarium fails to contain the fish at some point.
The actual animation runs considerably faster compared to the video shown here, as the software that to rendered the simulation had no frame rate syncing.
The simulation also includes a simple L-System for generating plants.
Full source code is available on the following site:
http://www.dominikdeak.com/index.php?page=graphics-assignments
Link to this comment:
All Comments (0)