Share your repls and programming experiences

← Back to all posts
A simple raymarcher using Python's Turtle Graphics
janKawa (1)

This spawned from a joke on a discord I am a part of, and since it was completely possible, I did it! This does use pure python (by my definition: pure python means you're only allowed to use the packages that come by default in a normal python installation). Since the turtle graphics are the only "pure" way to draw stuff, that's how I did it.
The code of this post was based off of https://michaelwalczyk.com/blog-ray-marching.html, an excellent resource for beginner raymarching.

Try messing around with the values! Currently, it only renders a colored sphere (size of sphere, size of drawing square, FOV, and the colors of the background and the sphere are all controllable). If you know enough about raymarching, you could try implementing a different SDF, or better shading. Currently it uses cheap shading which doesn't work too well but runs fast.