What is CityGen ?
CityGen is a procedural 3D model generator application aimed for generating random urban
models. These models are generated from an XML construction file using several
simple operations and random inputs. Developed as a side project from my "Ray-Space
Factorization for From-Region Visibility" paper.
CityGen and the models created by it are free. For detailed licensing information see LEGAL.TXT
Installation
CityGen does not require installation.
1. Simply unzip the distribution file to a folder
2. Run CityGen.exe
Generator overview
The city generator begins by splitting the city
plane into equally sized axis-aligned cells. Geometry is generated
separately for each cell. The generator currently has two types of cells: either building
or a road cells. The only difference between these types of cells is
the construction template used for generating the model within them.
For each cell, the generator picks a construction template at random based on the cell type. It begins filling the cell bottom up by applying a sequence of operations defines in the chosen template. Each operation can transform the active cell (scale, rotate and elevate it) or it can draw in it either a floor, a box or a pyramid. Operations are performed one after the other where usually the next operation will continue from the end-state of the previous one. For example, if a box is draw then the next draw operation will place something on-top of that box.
To allow creation of more complex templates, the current state can be saved and restored, either fully or partially using push-pop operations. Finally to simplify the construction file, maybe and choose operations supports random variations in the sequence of operations used.
The construction file
The construction file defines global city
parameters and the construction templates
for the cells. The construction file is an XML formatted text file that uses
CityGen's schema file. The main benefit of using XML for this is that of-the-shelf tools exist
which assist in writing such construction
files.
To that purpose, I strongly suggest that you use a validating XML editor (validating means that the editor verifies the correctness of the construction file using the supplied schema file). Advance validating editors support auto completion and other features that can further assist you. I recommend the following editors:
XMLSpy - An excellent commercial editor with shareware versions from Altova.
XmEdiL - A free editor with an impressive feature set.
For description of CityGen construction file syntax consult the examples and the detailed documentation.
The GUI application
The CityGen GUI application lets you generate
models by loading and "running" the construction files. It supports several
options for exporting the model to VRML 2.0 files:
VRML Options: | |
Triangulate everything | The model can be exported consisting of only triangles (checked) or mixed planner rectangles and triangles (not checked). |
Save Roads | Whether or not to include road cells in the output VRML files. |
Model Collapse Modes | |
Normal (textured) | Textured output where each building is composed of several shapes |
Collapse to building | Each building is a single VRML shape node and
therefore has only color, no texture. This option generates a simpler VRML output files. |
Collapse model | Produces a single VRML shape node for the
entire model. This is the simplest VRML output file. |
The application also comes with a navigatable
preview window so you can quickly see the resulting city.
To navigate use the following keys:
Preview Window | |
Fly keys | Are the arrow keys + 'Home' and 'End' keys. Used to navigate forward/backward. |
'+'/'-' | Increase/Decrease navigation speed |
Shift + Fly keys | Rotate axis. |
Shift + '+'/'-' | Increase/Decrease rotation speed |
'r' | Reset position to initial position. |
Notice that CityGen prints the random seed used for each city it generates. This allows you to recreate the city with CityGen later by setting the randomSeed attribute of the CityGen root node in the construction file (See CityGen root node in the construction file documentation).
Distribution content
CityGen.exe | The program executable |
xerces-c_2_3_0.dll | Xerces XML parser DLL (see LEGAL.TXT) |
xsd\CityGen.xsd | CityGen XML Schema file (do not modify) |
textures\ | Some city textures to get you started |
example1_cfg.xml and example2_cfg.xml |
Example city configurations to get you started. I strongly recommend that you review them before writing your own construction configuration files. |
example*.wrl | Example VRML 2.0 results generated from the example files using various VRML output configurations. See VRML output section of this README for more details. |
docs\ | Detailed HTML documentation for the construction files. |
Contact info
For bugs, comments or questions, email me at
tommer@tau.ac.il.