Ray Casting
The purpose of this assignment was to create a k-D Tree, and then use it to efficently cast rays for rendering a scene. The framework was provided by the professor, and all I did was calculate an efficient k-D tree for the scene, and then raycast points using the tree.
You should try disabling the re-calculation of points at least once, and then move the scene around. It's a neat effect.
In OpenGL mode, the k-D tree is rendered. A blue box is the root node, which contains the entire scene. If you press O to go up a depth, the whole tree is drawn at once with the deeper the node is in the tree, the smaller the box gets drawn. If you go down, Red boxes are left child nodes, and green boxes are right child nodes.
The k-D tree is constructed using the surface area heuristic algorithm.
Controls
Left click - Rotate the scene
Right click - Translate the scene
Mouse wheel - Zoom
G - Toggle raytracting
After pressing one of the following, you must interact with the scene for any
changes to appear (I.E. Move the scene, or click the window):
In OpenGL Mode:
I - Increase the depth of the tree being drawn
O - Decrease the depth of the tree being drawn
In Raytracing Mode:
P - Toggle re-calculation of points when moving the camera