Isometric Grids in Python

A bit down and to the left

Keno Leon
5 min readDec 11, 2020

--

I love isometric views; they pack a bunch ( punch ?) of visual information and are great for sketching pseudo 3D views, making them programmatically on the other hand has always seemed daunting, at least to me, come along as I face my isometric fears and build one from scratch in python.

Here's a typical isometric Grid/Image and a simple approximation of what's going on which we will use throughout, starting from a simple square you rotate it 45° and then squish it so it is twice as wide as it is tall. 
Prerequisites: If you want to code along you'll need pygame, although hopefully what we learn here will work for other libraries that can draw lines and place sprites on a canvas, same goes for other languages. If you need a primer on grids/Pygame check this other post : Making Grids in Python.Note: Not an optimized Pygame solution, use/tweak the game loop as per your needs, this one for instance runs all the time which might not be what you want, the last example adds some basic animations if hat's what you are after.

--

--

Keno Leon
Keno Leon

No responses yet