Ray-tracer evolution
In the last post I showed my finished ray-tracer. Now Iām going to show the steps I took to get there.
I started creating Lines and Spheres in geometry.py and generating an PNG image with PIL in render.py. The first image I was able to generate was:

Adding colors and an extra sphere was easy:

Then I tried adding a Horizontal plane:

Making it checkered:

But it was in the wrong place:

After fixing the positions:

Next I tried implementing shadows, it took me a few tries:

How could I make the spheres look 3D? I followed the part about diffuse lighting in these slides.

Swapping a 2.0 with a 2 in a division in render.py resulted in:

Next step was adding reflections, it was easier then shadows:

And finally:

tags
