Introducing Sphere Mazes
Learn how to create a sphere by putting two hemispheres together.
We'll cover the following...
Understanding sphere mazes
Creating a maze on the surface of a sphere shares a lot in common with creating a maze inside of a circle, which isn’t surprising! A hemisphere, after all, is just a circle that’s been lifted up by its origin like this:
We can create a sphere by putting two hemispheres together, which means we should be able to implement a spherical grid by leaning on our polar grid. We’ll need to change a lot of the calculations behind the measuring of the cells, and our to_png method is going to need rewriting, but it’s a start.
So here’s what we’ll do. We’ll subclass our PolarGrid to make a HemisphereGrid, and then glue two of those together to make a SphereGrid. We’ll put all these in the same ...