Here you can find a small, simple ray tracer in Java for demonstration purposes. I created seven different versions, each with a new feature, to illustrate how these features can be successively integrated into the ray tracing code. These versions are:
Note that this raytracer was not created to be efficient - otherwise, I would not have written it in Java in the first place, since Java is a poor choice for a fast raytracer because many small objects have to be created, which is not something that Java handles well. This raytracer was created merely to illustrate the basic ideas behind raytracing and how to implement them.
Picture gallery of different versions
Interactive demo (Java applet)
Code and compiled class files (.tar.gz, 2.7 MB)
Executable JAR file (2.7 MB)