To do simulation,
- first replace the ext folder with the one in proj4 repo.
- Change the relative path to bird model in line 262 of
flockSimulator.cpp
according to your OS. - Then compile the repo in the same way as previous projects: (e.g. for mac)
mkdir build
cd build
cmake ..
make
- Finally run
./clothsim -f ../scene/env.json
or./clothsim -f ../../../scene/env.json
.
- Press "P" to pause or continue.
- Press "N" when paused for next timeframe.
- Press "R" to reset.
- Press "S" to turn on/off stop mode (birds will stop on the pole when close enough).
Features currently implemented:
- Point mass model for birds.
- Internal forces cohesion, separation and alignment, and external force wind
- Bars representing telegraph pole. When stop mode is on and birds are close to the pole, they will stop on a random position on the pole.
- interactive features, including:
- Set designated direction (x, y, z).
- Weights for Cohesion, Separation and Cohesionn.
- Set number of birds for simulation.
- Set simulation speed of birds by number of frames/s and number of steps/frame.
- Set a way to render birds (wireframe or ball).
- env has one tree
- env1 has three trees