Assignment #4

Exploding Cubes

Due: We. Oct. 20th (2 weeks)
Score: 10 points


This assignment has to be done by everyone if not specified otherwise. All people who do NOT have to process this assignment will be informed by me personally on Wednesday. These will be the people already heaving a huge programming load due to the projects they are working on. If you are not sure if your load is high enough to qualify for this relief please contact me so that there will be no misconception.

No battleships this time, but exploding cubes... please download and start the Visual Studio Project BOUNCING CUBES. As the name tells you, this program shows cubes that bounce around in a 3d environment. After a while they explode (to moderate the impression of violence the explosion is modeled by a rotating cube that disappears after a while - you can easily change that, if you want to). You will (hopefully) see something like this:


Your task:
Alter the code in a way that the cubes do not explode after a while, but only if they collide with each other, i.e. any cube colliding with at least one other cube should explode, any non colliding cube survives (until collision occurs).
You can get 1 bonus point by changing the explosion sequence and add something more creative. The best explosion earns 2 bonus points (About the mode who decides which one's 'the best': as a test for november we will elect it).

You have to use the 'Sort and Sweep' algorithm to detect collision of multiple objects. I will talk about it on friday. You can read about it in my slides (Collision: part III: collision of multiple objects) to prepare.


JAVA programmers:
The flashy application of bouncing cubes is not necessary to program sort and sweep, it's just a nice display. You can hand in the pure sort'n sweep algorithm, working on a set of 3d cubes. Please also hand in some test-data that proofs your code is running correctly. You can gain 2 bonus points if you get an animated application running, similar to the c code !


Have fun !