r/creativecoding • • Nov 05 '26

Every building, tree, boat and person in this isometric town is drawn by code: one town, 14 architectural traditions from Cairo to Xi'an

This is the website for my local Muslim community group in Ottawa: an isometric town you can explore, which redraws itself as cities from across the Muslim world. Everything is drawn in plain Canvas 2D (no images, no engine), about 40,000 lines of it.

The pictures, in order

  1. The same town in four regions: Mamluk Cairo, the Malay Archipelago, Xi'an, Ottawa
  2. The Shah Mosque in Isfahan, tiled domes and all
  3. Mughal Delhi at night, with the Taj lit up across the town
  4. Damavand and the Alborz fading into mist
  5. An Ottoman mosque and its neighbourhood

6 & 7.

  1. Tap anything for its story: the Djinguereber Mosque in Timbuktu

and Zheng He’s treasure ship

Rules that shaped the look

These came from things that looked wrong, and every one went into the project's notes so it held from then on:

Everything is lit from the upper right: buildings, mountains, trees, rivers. A single light direction is what makes hundreds of separately drawn things read as one world.

A caravanserai first came out as a busy miniature (court, rooms, pool, all crammed into one plot) beside simple full-size houses. Now every building uses the same size of doors, windows and domes as its neighbours, and shows the street view, not a cutaway.

Some minarets looked like they were floating. Adding piers and cornices didn't help. The real cause was their bases clipping the wall in front like stickers. Moving them fully onto the roof fixed it.

Trees started as flat ovals. Now each one has a lit side, a shadow and clumps, and each region keeps its own silhouettes: a date palm stays a date palm, a poplar a column.

Mountains and rivers meet the plain along wandering lines with bays and spurs. Straight edges instantly look unfinished.

Haze grows with distance, so the far mountains and cities fade back and the town stays the subject.

Happy to discuss any of it!

Check it out yourself here at mypo.ca

46 Upvotes

8 comments sorted by

5

u/GrogRedLub4242 Nov 05 '26

AI-gen code?

0

u/TheRealManjikarp Nov 05 '26

A little bit me, a little bit Claude….especially for tedium boilerplate.

Artisanal coding is a skill I’m slowly starting to lose. But I had fun with the building art.

2

u/thicket Nov 05 '26

I think these different visual styles are a great reference to understand different historical periods. Since the city design is the same, they’re kind of skins on top, right? Id also love to see some city designs based on historical examples. Like, how did the scale of Mansa Musa’s Timbuktu differ from Xi’an or Abbasid Baghdad? Were they similar sizes? Did they all feature central courtyards and central hero buildings like it does here, or were other districts more prevalent in some eras than others?

I love how recognizable these are, and they got me excited about the little pieces I know about different Islamic eras and regions

3

u/TheRealManjikarp Nov 05 '26

ya exactly, skins on one layout! real cities were way different though lol

Baghdad (not here) was literally round, Xi'an was/is a giant grid, Timbuktu way less dense and spread out IIRC and built around its mosques

honestly now you have me thingking....a historical layouts mode would be so cool...lol

2

u/thicket Nov 05 '26

I love this as a way to experience different eras in history. It’s one thing to look at a map, but another thing to see a city grow up, in its own particular style. 

1

u/TheRealManjikarp Nov 05 '26 edited Nov 05 '26

Posting the region switching video here cause I couldn’t add it to the posts photo library lol

2

u/AnoncracyHQ 25d ago

tried switching from Madinah to Xi'an. keeping the building names in place made it easy to stay oriented. could the region picker show a small preview of each style?