Ray Tracer (2008)

To further expand my knowledge of all things technical, I decided to try my hand at writing a simple ray tracer in Java, for simplicity. The end result is a simple applet (must be run via appletviewer) capable of rending a series of spheres.

Ray Tracer in Action

From this experiment I've learned ray tracing theory, and managed to implement shadowing from omni, spotlight, flood light and ambient light sources, ray-sphere collision testing, sphere texture mapping, reflections, refractions and super sampling. This code gives a simple demonstration of these concepts, and is written to be easily understandable and modifiable rather than efficient. The applet is also my first attempt at writing an application that is multi-threaded, bettering performance on multicore systems.

To run, place ten image texture files named "Tex0.jpg" through "Tex9.jpg" into the application directory, compile the applet using javac and run via appletviewer. Adjust values in Constants.java and the scene creator java files as desired.

Downloads
 

Vital Stats

  • 28 Years Old
  • Australian
  • Lover of embedded systems
  • Firmware engineer
  • Self-Proclaimed Geek

Latest Blog Posts

RSS