./fishtank sample.in sample.out
The assignment is to write a program that performs a simple crowd (Boid) simulation.
The wikipedia page has a number of useful links
about the model and the original paper is linked here and
is fairly easy to read.
Boids should react to other boids
that are
~adamb/public/Fishtank/fishtank sample.in sample.out
size neighbor_radius mass collision centering velocity hunger damping dt lengthsize is the size of the boid. This is useful for telling if the boid has consumed food. neighbor_radius is the distance the boid can see, any boid farther than neighbor_radius is ignored. mass is the mass of the boid. collision, centering, and velocity are weights for these various forces. hunger is a weight for the force that draws boids to the nearest food. damping is a "mass proportional damping" constant. Multiply the velocity by this constant every timestep. dt is the timestep size. length is the length of the animation.
After that boids and food are specified. The next line has the number of boids, nboids, followed by nboids lines with two Vector3, the first is position, the second is initial velocity. Then the number of pieces of food, nfood, followed by nfood lines with two Vector3s (again, position followed by velocity) and a float that give the time that the food should be added to the system.
For 15 points of extra credit, use a kd-tree to accelerate neighbor queries.
For 30 points of extra credit, feed the Boids with a particle system. Don't ignore the food in the input. When the time in your simulation passes the time that the food should become active, add the food to the system. The food falls slowly through the scene with small random perturbations to the x and z components of the velocity. There is an additional force on the Boids that draws them to the food and when they get close the food is eaten and disappears.
For up to 40 additional points, extend your program with additional phenomena or forces. Be creative. Points will be awarded based on how cool the grader thinks your enhancements are. There are lots of ideas for extensions in the various links on the wikipedia page and here
Turn in this assignment electronically by pushing your source code to your proj5 GitHub directory by 11:59 PM on the day of the deadline. We will be looking for multiple checkins documenting your development process.
As always, double check that you have submitted everything we need to build and run your submission, but no generated files (.o's, executables, or images). Be sure to include a Makefile that will build your project when we run 'make', and a readme.txt file telling us about your assignment. Do not forget to tell us what (if any) help did you receive from books, web sites or people other than the instructor and TA.