Images with shadows can be generated by an elaboration of this process, first throwing a ray from eye to world, then noting the co-ordinates of the point of first intersection. A ray from each light source is then launched at the point of intersection of the eye ray. If it first impacts at the same point, the point is illuminated by that light source. The throwing procedure works recursively as follows. If none of the subcube invocations responds positively, it returns a negative response.
Collision detection is a simple process once the tree is built.
A recursive procedure examines a node, and if it is simple checks if two objects intersect. Building the tree representation from an object oriented description is the most difficult operation encountered so far. The building procedure inserts the objects one at a time into a tree space, and for each one proceeds as follows. It asks the intersection question of the top cube. A simple recursive procedure which marks all existing subtrees of the current one in a similar manner is also invoked.