Not So Simple Ray Tracing

There are two versions of this applet:

one with most basic features (and faster)
- phong shading with two light sources
- five colored spheres (one central, and the other four symmetrically around it)
- those spheres have good reflection
- there is a sixth ball, initially in front and slightly higher, which refracts
- simple shadows
- objects could be rotated, the focus could be change, and the applet could be resized
similar to the previous with more advanced features added
- boolean-combined objects
- central boolean object surrounded by eight spheres (all with good reflection)
- concave mirror, initially behind those objects
- magnifying lens, initially in front (the lens could be removed from the scene)
- the lens and the mirror are 'transparent'
- as before, rotation, focus change, and applet resize are supported
- fog could be turned on/off
Both applets use 400x400px by default, but that could be changed up to 800x800.
Detailed pictures take from a few seconds at 400px up to approximately thirty-sixty seconds at 800px.
To get a good picture, one could rotate and focus things in a nice way, and then go large size.
(all snapshots are taken from the real applets)
Annoyingly, the fast dragging (rotation) in both applets sometimes causes a freeze, in which case
you should click the refresh button; the problem is extremely rare when using the appletviewer!?

Source code: src/