Esri CityEngine allows you to generate high quality 3D urban content using procedural rules. Writing rules isn’t every-body’s cup of tea though especially with no programming background. Then again it isn’t as hard as you might think. Let’s have a look at creating your first building.
Fire up CityEngine and drag ‘n drop the Results.gdb from the CityEngine: Philadelphia example into a new scene. Select the building footprint feature classes and hit Finish.
“Click on the images for full-res versions”
Create a new rule in your rules folder. Right-click on the folder and go ‘new->CGA Rule File’. CityEngine creates the CGA file and opens the rule file in the visual editor. Make sure you set it to showing visual as well as textual.
Now let’s just simply extrude our building. Add the following lines to your CGA file, save (ctrl S), select a footprint, drag ‘n drop the rule file on it and hit Generate (ctrl G in viewport).
Our start rule is called Footprint and in this rule we are extruding the start shape (selected footprint) randomly between minHeight and maxHeight and call the result MassModel. Next we are going to split the MassModel into Facades and the Roof so we can do different things to it.
The MassModel rule colors the building red and splits it into components (side and top) which get the Facades and Roof rules. Next we are going to split the Facades into floors using the Facades rule and add a roof with the Roof rule.
The Facades are split approx. every 3 meters into floors (-> Floor rule) and the roof will be a gable roof with 30 degree angle, 2 meter overhangs and a yellow color.
We can add 3D windows to the floors by splitting the floor and inserting a 3D model of a window.
The floors are split horizontally approx. every 2 meters into windows (-> Window rule) and at every window location, we are inserting a 3D model of a window loaded from our CityEngine assets.
Very nice as Mr. Shephard would say. To finish off, let’s have a quick look at texturing the building instead of giving it a color and inserting 3D windows.
We have added a new variable called ‘Show_Textures and if this is set to true, we’ll color the building white, setup a texture projection and add the texture from the assets folder to the facades in the Facades rule. Similarly we can do this for the roofs in the Roof rule.
And….. we’re done! Say hello to your first procedural building.
Now you might think, why do this procedurally? Why not use a traditionally 3D modeling package? Well… the benefit from procedural modeling becomes apparent when you need to create a lot of 3D buildings that need to have variation.
Select all buildings in your viewport and drag ‘n drop the HelloBuilding rule file on the selection. CityEngine creates a 3D building for each footprint according to the default variable settings.
Now using the Inspector (Window -> Inspector), you can dynamically change the 3D building models. Each variable (attr) we created in the rule file is automatically exposed in the Inspector window and can be modified interactively. This is extremely powerful. Have a go at changing the settings in the Inspector window and see how the 3D city is updated immediately.
Of course, this is a very simple rule file which only shows a fraction of what you can do with CityEngine. Next we will explore how you can use GIS attributes to drive the CityEngine parameter values allowing you to generate 3D buildings based on your GIS footprints using attributes such as ridge height and roof form.
You can find the rules and assets used in this post on ArcGIS.com.
Gert van Maren
Product Manager 3D