Skip to content

Boid simulation using threepp, originally made for assignment

License

Notifications You must be signed in to change notification settings

Floofball-uwu/BoidSimulator

Repository files navigation

BOIDS

A cross-platform 3D boids simulation originally made for a course assignment. Written in C++ using the threepp and imgui libraries.

flyingBoids.gif

Features:

Retro-ish polygon graphics (and lighting)

Boids

  • They fly!
    • Cohesion
    • Alignment
    • Separation
  • Support for N number of boid groups. This means different boid configurations interacting!
    • No group-specific behaviors yet, like predators or flying away from other species, or simply ignoring them.

Changing stuff through UI

  • Boid config parameters
  • Amount of boids per config
  • Pause simulation
  • Toggle debug visuals

How to use

To use the project, simply compile it with CMake and run the BoidsProject executable.
Rotate the camera with the LMB (Left Mouse Button), and move it with RMB (Right Mouse Button) or with the arrow keys.

If you want to just use the boid simulation itself however, it is just a matter of creating a simulation manager and then giving it some boid configurations. Afterwards just create the boids using that configuration in the SimulationManager. For a quick example on how to do this, see setupBoidSim() in main.cpp.

Screenshots

Boid flocks

boids1.png boids2.png

Debugging capabilities

debug1.png debug2.png


References:

Wikipedia Boids article was used for general info about boids and to map out the core features.

Ben Eater's Boids was used for referencing "correct" boid behaviour.

This article was used finding out that I am supposed to use velocity and not positional targets, where the boid then tries to home in as default behavior. However by some miracle positional targeting did work, it was just a bit... peculiar in some cases.

About

Boid simulation using threepp, originally made for assignment

Resources

License

Stars

Watchers

Forks

Packages

No packages published