To access the tutorials in CityEngine, click Help > Download Tutorials and Examples. After choosing a tutorial or example, the project is automatically downloaded and added to your workspace.
Use polygonal modeling and rules
Suppose you want to give all windows of this house a 3D frame.
Currently, it’s just a flat texture. You could drag the frame out for every window, but this can be tedious. Also, the window texture does not adapt well when scaled. You may get some cuts in the windows.
To conveniently place 3D windows, use a rule on the building.
- First, create a 3D window. Use the rectangle tool and drag it up.
- Select the front face with the selection tool and assign the window texture with the texturing tool.
- Draw a few rectangles over the window frame with the rectangle tool. Drag them to create a 3D structure. Optionally, experiment with different structures.
- Select the model, and choose File > Export models..
- Choose Wavefront OBJ and set the name to window.
- Click Finish.
- Select the house, and right-click Assign Rule File.
- Select rule.cga from the tutorial folder, and click generate.
- Bring up the Inspector window and select the house.
- Type values in the window parameters.
All the windows update automatically.
The window is finished.
To use it in a rule, you must export it first.
Make sure the folder is the tutorial/model folder.
Now you can apply the rule.
Note:
This rule replaces all polygons with window textures with the 3D window. You can look at it and use it for your projects.
All windows are now 3D shapes, and you can see the difference by switching the show/hide models toggle button.
If you drag the window frame, it adapts much nicer.
You can also change global parameters.