If anyone would like to see ray tracer code, have a look at pov-ray http://povray.org Its a venerable old ray tracer but has some of the best features around and the code is very readable (once you've got the basics). It's a different way to do things than the vertex/shader style rendering pipeline.