Title: Use ray tracing to draw an interesting collection of colored blocks in Python
This example uses the techniques from my book Build Your Own Ray Tracer With Python to draw an interesting collection of colored blocks. Writing the example was pretty easy, although it took a while to get all of the checkerboards arranged properly. (There's undoubtedly a better way but I was tired and just brute-forced it.)
All of the code that makes ray tracing possible is far too long to show here. Buy the book to see how that works.
You also can download the code, although it will make a lot more sense if you read the book.
The colored image is kind of confusing, so here's a version in yellow.
|