[Cityengine tutorial documentation]-01 basic tutorial

Source: Internet
Author: User

This document is an ESRI cityengine learning document. It is an official example of cityengine_2011_tutorials tutorial 1 --
The Chinese Translation of "tutorial_01_cityengine_basics_2011" is prepared by the Chinese translation of netizens in winter and winter.

I am very grateful to the netizens for the winter and winter. I also welcome more netizens to provide more technical articles (please visit Sina Weibo and @ ArcGIS _ ). I will share with you in this column. Tutorials 02 and 03 have been translated in winter and winter, and will be updated later.

Tutorial Introduction

This tutorial explains how to use cityengine to quickly create a city from scratch. By explaining the functions of cityengine, you can understand the complete workflow. You will learn how to create a new project, create a road network, and set "shape creation Parameters ". Finally, you will learn how to use the rule editor and generate a city building model.

Part 1: Create a new project and create a new project and scenario

Step 1: Create a New cityengine project.

Choose File> New> cityengine project]

Click Next, name the project "firstcity", and click Finish]

After completing the preceding operations, a new project is created and displayed in the file navigation window (the file navigation window is located in the upper left corner of the cityengine interface by default ). These automatically generated folders are used to store your project data, such as the assets folder (used to store textures and referenced model part data) and the Rules folder (used to store rule files.

Step 2: Create a new scenario:

Choose File> New> cityengine.Scene]

Confirm the folder location (/firstcity/scenes) of the new scenario, name the scenario "firstcity_01.cej", and click "finish]

Our workspace now contains a new empty project and a scenario file:

Copy rules and resources

Later in this tutorial, we need to use the rule file and resource (assets) to generate a building model. Therefore, we need to copy these files from the sample project supporting the tutorial.

First, import the sample project in tutorial 1 to the current workspace.

Download and import the Tutorial Project (Tutorial 1) to our workspace

Next, we copy the required files from the downloaded tutorial 1 Project to our new project.

Go to the resource (asset) folder in tutorial 1.

Copy and paste (CTRL + C and CTRL + V) all files and folders in the resource (asset) folder to the resource (asset) folder of the newly created Project.

In the same way, copy the "building. CGA" rule file in the Rule folder to the rule folder of the new project.

The following figure shows your navigation window:


Now, we are ready to create the road network and building model for the second part.


Part 2: streets and buildings

Create a road network

Step 1: Create a road network

Click the viewport window to activate it.

Select graph> grow streets ...]

Select the default settings to create a city.

Click Apply and close the dialog box.
Click the "frame all" button in the toolbar above viewport (or click the "A" key on the keyboard). The full graph in the viewport window shows your new road network.

Now, the road network shown in and the default building shape are displayed in your viewport window.


Now let's take a look at the scenario editor window"Scene Editor". You can find that a new layer named "streetnetwork 1" has been generated.



Modify "shape creation Parameters"

Now we have changed some shape creation parameters to make the scenario look more interesting.

Click "a" to display the full graph layer of the current scenario.

Hold down the left mouse button and drag a rectangle from right to left to include all the elements in the scene.

Locate the Inspector panel in the upper-right corner of the cityengine window, and click the "blocks" tab.

Open "Block parameter" and you will see "shape creation Parameters ".

Set type to offset subdivision (Offset subdivision)

Set the minimum area (Lotareamin) To 300

Set the maximum area (Lotareamax) To 600

Offset width (Offsetwidth) Set to 20

Instead of segmentation recursion (Subdivisionrecursive) Is set to no (false)

Observe the changes in the building shape in the scenario

Next, we will go to the third part to learn how to apply the CGA rules to the Building Shape and build a building model.

Part 3: Introduction to applying CGA rules and generating model CGA rules

In cityengine, CGA rules are used to describe 3D models. A cga rule file consists of several rules used to define how a 3D model is generated. When a CGA rule file is specified to a shape (such as a building block), the Building Model starts to be generated. In this section, we will apply and modify a simple CGA file consisting of basic rules.

Apply a CGA rule File

In the 3D window, click inside a shape to select it.

In the toolbar, click the Assign button and select the "building. CGA" rule file.

Another way to apply a rule is to drag the rule file directly from the navigator to the selected shape in the viewport window.

Now, the Inspector window should be shown in

Browse CGA rules and set initial Rules

Before generating the model, make sure that the initial rule for the selected shape is set to "lot" in the Inspector window. This setting is usually the default one. Note that the name of the initial rule is automatically generated by cityengine, but can be modified.

Keep a shape selected in the previous section and find the start rule attribute in the Inspector window.

Double-click the rule file to open the rule editor window. The property of the rule is displayed on the left (yellow tab) and the chart of the actual rule is displayed on the right (gray tab.

Click the button shown in the Red Circle to maximize the editing window.

The rule is located at the root of the Rule graph, where the root refers to "lot ". This rule will be the starting rule for the selected shape.

Check the Inspector window again and confirm that "lot" is selected at "Start rule" ("lot" is the default value), as shown in.

Now we are ready to generate realistic building model ry.

Generate the first building model

Confirm that the selected shape is still in the selected status and click Generate.

The building model appears above the selected shape

Click the selected model and choose "delete model" from the shortcut menu to delete the model.

Generate a new model.

We are now ready to modify the model. First, we will modify the attribute of a rule -- building height (building height ). Next, we will add a different roof for the building, so that we need a new CGA rule.

Modify the rule attribute "building height"

The height is set as a random value in the corresponding rule file. Use the update seed and generate models command to generate a building multiple times and observe the changes of each generated building.

View the default definition of building elevation in the Rule Editor:

In the Inspector window, locate the rule parameter "rule parameter ".

Modify the value of the elevation height parameter to 18 ". The font of the parameter value changes to bold, which is the user-defined value.

Click Update seed and generate models again ). We can find that the height of the building model does not change. You can reset it to the default action by clicking the Black Triangle icon on the left of the number "18.

Next, we will add a new rule for the roof.

Add a roof rule

In the Inspector window, click the rule file to open the rule editor.

Find the "lot" rule and click the "v" symbol in the upper-right corner to expand it.

In the "comp" section, right-click "shape" and choose from the context menu to create a new rule.

Name the new rule "roof ".

Observe how the new rule is generated and connected to the "lot" node.

To create a roof model, we now insert a one-person-shaped roof image (also known as the double slope ). Right-click "shape" in the "roof" rule and find the roofgable (angle, overhangx, overhangy) operation.

Observe the generation of the roofgable operation. Click the three parameter values and enter 20, 1, and 0 as the roof parameters.

Click Generate to view the generated model.

Generate a small city model

In the last step, we will apply the rules to a large number of shapes. To assign rules to a large number of shapes, we use the selection menu.

Select the generated model.

Right-click the 3D view and select-> select objects of same Group to select a large number of shapes.

Click the Assign button to assign the building. CGA rule to the selected shape.

Click Generate to generate the model. Note: Based on your selection, a dialog box about the starting rule "lotinner" or similar warning will pop up. You can ignore these dialog boxes because we allocate rules to all shapes, but our Rules do not contain the starting rules such as "lotinner.

Now you can see some buildings with different heights.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.