#011  /  020

City Life

Generative city building code written in Processing.
Project on Behance

Personal work
Creative coding

City Life is a Processing project that generates random cities from given elements. It can export to vector format so theoretically infinitely complex and scalable graphics can be created. The building panels and it's decorations are easily expandable, as of now, over 350 artboards were created in Adobe Illustrator and the processing project is about 1900 lines long. It is optimised so that it can be readily drawn with a pen plotter tool such as the AxiDraw.

The image is built on an equilateral triangle grid, alternating in direction. There are several passes for the image:

  1. The grid is laid out
  2. Buildings are placed from top to bottom randomly
  3. Some special cases are corrected (like the intersections of rooftops)
  4. Decorations are placed based on the building style and panel variation
  5. The electrical wires and the birds sitting on them are drawn
  6. The flying birds are drawn. They are not placed on the grid and they rotate based on a Perlin noise field to simulate flocking
  7. The frame is drawn