Swarm behaviour is widespread in the animal kingdom. It occurs in groups of birds, bees and countless other animals - even humans. The goal of this project was to simulate the swarming behaviour of fish. More specifically, the schooling behaviour of fish, which refers to coordinated swimming. The developed schooling simulation is based on Boids algorithm that Greg Reynolds published in 1987. The algorithm consists of three rules that each individual of the group will follow. These rules are separation, alignment and cohesion. In this project, these rules were implemented and additional rules for random direction, predator avoidance and obstacle avoidance were developed.
Live demo: https://vetemaa.github.io/fish-simulation.
Can be run by opening index.html on a browser that supports WebGL.