[Rod Stephens Books]
Index Books Python Examples About Rod Contact
[Mastodon] [Bluesky]
[Build Your Own Ray Tracer With Python]

[Beginning Database Design Solutions, Second Edition]

[Beginning Software Engineering, Second Edition]

[Essential Algorithms, Second Edition]

[The Modern C# Challenge]

[WPF 3d, Three-Dimensional Graphics with WPF and C#]

[The C# Helper Top 100]

[Interview Puzzles Dissected]

Title: Use ray tracing to draw an interesting collection of colored blocks in Python

[An interesting collection of colored blocks drawn with ray tracing 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.

[An interesting collection of blocks drawn with ray tracing in Python]
© 2024 - 2025 Rocky Mountain Computer Consulting, Inc. All rights reserved.