Skip to content

A Python script that generates a colorful voxel city and writes it to a MagicaVoxel .vox file

License

Notifications You must be signed in to change notification settings

sourcedennis/voxel-city

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

voxel-city

A script that generates a colorful "low-voxel" (like low-poly but for voxels) city. It produces a .vox file that can be rendered with MagicaVoxel. It also produces a .png floorplan image of the city.

Blog Post

Rendered City 1

Running

Running requires Python 3, as well as the Pillow Python library (for writing the PNG).

Then simply run with (where my python references python3):

python voxel_city.py

Note that this takes about 70 seconds to execute (on my machine). When executed with assertions disabled, it runs in about 55 seconds. This is done as follows:

python -O voxel_city.py

Note that I use Python's type annotations, where I use mypy to perform the type checking (mypy voxel_city.py).

Rendering

The .vox file can be rendered with MagicaVoxel. (It runs with Wine - for *nix users)

Before rendering, I adjusted the first 3 colors in the color-palette (used for the building windows) to be emissive.

Rendered City - Night

Rendered City - Day

Rendered City - Top View Perspective

Rendered City - Top View Orthographic

License

BSD-3 - See the LICENSE file

About

A Python script that generates a colorful voxel city and writes it to a MagicaVoxel .vox file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages