Code Analysis: International City – Introduction

Here begins my analysis of the International City model, one of the rule packages that comes with CityEngine 2016.  This analysis will unfold chronologically, so I will not be repeating definitions, concepts and explanations. I selected International City for analysis because it matches my interest in tall buildings and because I wanted to understand this approach towards modeling “hero” buildings.

Oh... did I mention that one way to make money with CityEngine is in writing rule files for others to use?

Illustrations from this exercise appear in the photo gallery at the bottom of the page.

Create the model by going to File > New > CityEngine > City Wizard > Next.

We are first prompted to define the terrain by entering dimensions for the scene and a maximum elevation; we are accepting the default values for both.  The other parameters come straight out of the earlier tutorial on “Terrain and Dynamic City Layouts”.  We select three .png image files to create map layers for elevations, textures and obstacles. As noted in the screen prompt:

  • The heightmap is a grayscale image -- a typical digital elevation map (DEM) -- encoding the elevation of the terrain which optionally can be be textured using the texture map image. DEMs for various locations are readily available on the Internet.
  • Obstacle maps are used to limit street generation. Dark areas define water, rugged terrain, or other places where you want to avoid generating streets.

We are asked to select a street graph (network) style for our street layer.  If the model is location specific, note that we can import an OpenStreetMap (OSM) layer.  We can also select a city size based on the type of computer being used – notebook, desktop or workstation.  I am using a Dell Precision T3610 64-bit Workstation with an Intel Xeon E5-1620 3.7GHz CPU with 16 Gb of RAM running Windows 7 Professional. That’s some pretty good horsepower. I’m selecting a medium-sized street graph.

Finally, we select International City as the building and street style. Note the comment about templates creating low poly models, or models using a minimal number of polygons.  The examples and tutorials contain much more detailed examples such as the model for the Petronas Towers, very intricately designed twin supertall buildings in Kuala Lumpur, Malaysia that were briefly the world’s tallest buildings. We will get into these later.

It took about 1-1/2 minutes for my workstation to generate the model containing, among other things, more than 20,000 street network objects, 36,000 other objects and about 750,000 polygons -- a "low poly" model. There is a very well-defined urban core with highrise buildings, adjacent residential and business areas with smaller buildings, green areas and a road network that avoids our designated obstacles.

We can begin to get a sense of how our landscape is laid out by clicking on elements in the scene and looking at parameters in the Inspector window.

Click on a building and click the “F” key to zoom in; Under the Rules > International City tab in the Inspector window, change the building type and the height factor in the inspector to modify its design.

Under the Information tab, note there is a random “seed” number used to generate models. When you change the seed value, you will change the model you have selected.  Select the model and enter CTL+SHIFT+G or click the “update seed and generate models” button and watch the model change randomly.

Finally, click on various elements in the model and view their properties and parameters in the Inspector window.

We will begin to analyze the CGA code behind this cityscape in the next installment.

Leave a Reply

Your email address will not be published. Required fields are marked *