Box & Reflective Tetrahedron

Using a BSP tree for reflections and object intersection

Articles

Java applet, run by CheerpJ. Main class: Raytrace

This was built for efficiency with a single-class binary space tree implementation. The tree is stored in flattened, fixed size arrays for optimal performance - no expensive memory allocation and object creation or deletion.

The render buffer is a byte array which is displayed using a MemoryImageSource and an IndexColorModel (this is 256 colours).

Source 3 files