CS490 Supervised Undergraduate Research Computer Game Design Part I - Spring 2003 Assignment #2 --------------------- Starting with the Circles Demo which you can download from the Course Website... Choose ONE of the following to implement: 1) Add wall boundary collision detection so that the circles don't "escape", but bounce off the walls. Implement instantaneous point-line rebounding for collision resolution so that the angle of incidence equals the angle of reflection once a collision is detected. You should be able to implement this with four boundary collision tests, one for each wall. Finally, add collision detection so that all circles bounce off of an imaginary (not visible) box of a fixed size placed directly in the center of the screen. 2) Implement Brute Force circle-circle collision testing so that all the circles bounce off of one another. For collision resolution, you may use whatever method you prefer, including stopping the circles, incorrect rebounding, or correct axis-of-reflection rebounding. Try and implement your algorithm so that you do not calculate square roots to find the distances between circles. Once you have circle-circle collision testing working, test its performance by increasing the number of circles in the initialize() function. Record the elapsed time to complete 600 frames of animation (with a stop watch or a clock measurement in the code) for 10, 20, 40 and 80 circles. 3) Implement Axis Sorted Detection OR Uniform Spatial Partitioning for collision testing so that all the circles bounce off of one another. For collision resolution, you may use whatever method you prefer, including stopping the circles, incorrect rebounding, or correct axis-of-reflection rebounding. If you implement Axis Sorted Detection, you may use whatever sorting algorithm you prefer. It is not necessary to implement incremental sorting - ie. you can resort the entire set of circles on each frame. If you implement Unifrom Spatial Partitioning, you will have to apply a different storage mechanism for circles in addition to the one provided. Once you have circle-circle collision testing working, test its performance by increasing the number of circles in the initialize() function. Record the elapsed time to complete 600 frames of animation (with a stop watch or a clock measurement in the code) for 10, 20, 40 and 80 circles. NOTE: The Circle Demo program displays the number of frames processed in the upper left corner. When this counter reaches 600, the animation will freeze and the total elapsed time for those 600 frames will be displayed. This is for the purpose of recording your timing measurements. If you need to change the "last frame processed", adjust the LAST_FRAME variable in the program.