/3D-Boids-Ocean-Simulation

3D Boids: Three.js university group major project for our Computer Graphics subject. Simulating 5000+ fish inside an ocean with lots of shaders!

Primary LanguageJavaScript

3D Boids Ocean Simulation

Contributors: Stephen, Nathan, Michael, Erencan

Boids algorithm

  • uses octree spatial partitioning to optimise the simulation, can simulate up to 10k boids at 60fps
  • boids's behaviour is not affected by boids behind it (boid field-of-view)
  • customisable behaviour via GUI sliders
  • limited worldsize
  • avoids edges of the world
  • boids avoid boids which are higher up on the 'food chain' than them, food chain is determined by each boid's ID value.
  • boids follow boids which are lower on the 'food chain' than them
  • boids will eat and kill boids which are lower in the food chain
  • boids will reproduce with nearby boids and create copies of themselves. Each boid can only reproduce once. There is a cap on the number of fish that can be made

Project Dependencies

@types/dat.gui: "0.7.7" lodash: "4.17.21" potpack: "1.0.2" three: "0.153.0", three-nebula: "10.0.3", uuid: "3.4.0"