Simple simulation of boid behaviour in 3D space. Implemented using CUDA and OpenGL.
2023-10-05.14-55-09.mov
- Install CUDA with https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html, as well as third party libraries https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#install-third-party-libraries.
- Using
git
get https://github.com/NVIDIA/cuda-samples. - In
Makefile
setCU_LIBS
to point tocuda-samples/Common
. ExampleCU_LIBS=-I"~/cuda-samples/Common"
. - Run
make all
and you are set to runfishes
.
User can change parameters of simulation:
- Cohesion - press 1 or 2.
- Separation - press 3 or 4.
- Alignment - press 5 or 6.
- CPU/GPU mode - uncomment
// #define CPU
inmain.cu
and recompile (make clean && make all
) to run on CPU. Leave commented out to run on GPU. - Number of boids - update
BOID_COUNT
indefines.cuh
and recompile (make clean && make all
).