Tutorial 01 Essential Skills

Embed Size (px)

DESCRIPTION

Tutorial CityEngine

Citation preview

  • 1

    Esri R&D Center Zurich

    Esri CityEngine TUTORIAL 1: ESSENTIAL SKILLS

    Content

    Part 1: Setting up a new project 2

    Part 2: First street layout 5

    Part 3: Navigation and Selection 7

    Part 4: Model Generation with Rules 10

    Part 5: Rule editing 14

  • 2

    Part 1: Setting up a new project

    Setup new Project and Scene

    As the first step, were going to create a new CityEngine project:

    File > New > CityEngine > CityEngine project

    Hit Next, name your project MyFirstCity, then hit Finish. A new project has been created and shows up in the Navigator (by default located in the upper left corner of the CityEngine window). The default folders that store your project data, like assets, rules and scenes, are already present, though empty.

    Next, we create a new scene:

    File > New > CityEngine > CityEngine scene

  • 3

    Copy Rules and Assets

    Later in this tutorial, we need rule files and assets for the generation of the building models. We copy these files from the main Tutorial 1: Essential Skills project, which you should already have linked into your workspace.

    Next, we copy all necessary files from the downloaded Tutorial 1 project into our new project.

    Use copy paste (Windows and Linux: ctrl-c and ctrl-v // Mac OS: command-c and command -v) on your keyboard or from the right mouse button context menu

    Copy both the contents of the assets and rules folders. Your Navigator now should look like this:

  • 4

    (Continue with Part 2 on the next page)

  • 5

    Part 2: First street layout

    Random street grow

    After the new project has been set up, were ready to start creating the first street layout in our newly created scene.

    First, we are going to create a street network:

    Click into the viewport to make it the active window. Graph > Grow Streets .. Lets stick with the default settings for now. Hit apply and close the dialog.

    Approximately 500 streets were created, but we cannot yet see them all in the viewport. Lets frame the view to see them all.

    Hit the a key to frame all objects in the viewport. Your viewport should look similar to this:

  • 6

    Your Scene Editor should now contain a new Streetnetwork layer, containing a network of Blocks, Graph Segments and Shapes and look like this:

    (Continue with Part 3 on the next page)

  • 7

    Part 3: Navigation and Selection

    Navigation

    Navigating in the viewport is one of the most essential skills a CityEngine user has to master. Lets have a look at the different Navigation Schemes available:

    Edit> Preferences > General > Navigation Devices > Mouse

    The Current Mouse Scheme dropdown lets you choose among different schemes of other 3d applications.

    For those, who have a 3d Connexion 3d Mouse (http://www.3dconnexion.com/), there are specific preferences too:

  • 8

    But lets focus on the default Navigation Scheme:

    Alt + left mouse button: Tumble the view (Mac OS: option + lmb) Alt + middle mouse button: Pan the view (Mac OS: option + mmb) Alt + right mouse button: Zoom (Mac OS: option + rmb)

    (or use the mouse wheel)

    Another tip for efficient navigation of the constant use of the frame key f. There is also a frame button in the viewports toolbar:

    Note: Start using the tumble/pan/zoom based Navigation as early as possible. After a few minutes, it will become natural to you.

    Selection

    To interact and edit the objects in your scene, you need to select them. Selecting is done easily: Enter the Selection Tool (keyboard shortcut q), using the left mouse button. Select them by just clicking into the viewport!

    Note: The F9 F12 keys toggle the visibility of the 4 main object types: Map Layers, Graph Segments, Shapes and Models. Deactivating the visibility of other object types usually simplifies making proper selection.

    Selection types

    Single click: Selects a single object

    Right-to-left rectangular selection: Selects all objects inside or touching the selection rectangle

    Left-to-right rectangular selection: Selects all objects completely within the selection rectangle

    The left-to-right rectangular selection is usually used to select tiny objects such as single Street Graph Nodes when there are many objects occupying the same space.

  • 9

    Modifier keys

    The ctrl and shift keys toggle the different selection modes. The modes are also listed in the

    Select Tools submenu in the toolbar.

    Selection context menu

    Once you have a selection, the right mouse button context menu contains entries with which you can select additional elements:

    Select Objects of the same Type: Types: Shapes, Graph Nodes, ..

    Select Objects of the same Group: In the same Block / the same Street

    Select Objects with the same Rule File: Same Rule File assigned (on all visible layers)

    Select Objects with the same Start Rule: Same Start Rule (on all visible layers)

    (Continue with Part 4 on the next page)

  • 10

    Part 4: Model Generation with Rules

    3d Model Generation

    How are 3d Models generated in CityEngine ?

    CityEngine is a Procedural Modeling Application. This means that CityEngine uses rules to generate the 3d Model:

    Assigning Rules

    In this tutorial, the rules are already provided. In fact, we have copied them in the first steps of this tutorial. So lets use them!

    Select one Block and change its Subdivision Parameters in the Inspector from Recursive Subdivision to Offset Subdivision. (For more details on Block Subdivision and Dynamic City Layouts, work through Tutorial 2.)

  • 11

    Select one Shape within the Block, then use the context menu to Select Objects of Same Group.

    Drag and Drop the building.cga Rule File onto the selected Shapes (highlighted orange).

    After dropping the Rule on the Shapes, the Model Generation is automatically started. Your first buildings appear (Make sure, the visibility of Models is activated, toggle with F12):

  • 12

    Generated Models can also be deleted in the right mouse button context menu:

    Select the footprint Shape again and hit ctrl-g // Mac OS: command-g or use the Generate button in the toolbar to generate the Model on the selected Shape.

  • 13

    New variations of the buildings can be created by changing the Seed value:

    Use the Update Seed and Generate new Model button in the toolbar or hit ctrl-shift-g // Mac OS: command-shift-g.

    An example of different Seed values:

    Manually edit the rules building height parameter in the Inspector:

    (Continue with Part 5 on the next page)

  • 14

    Part 5: Rule editing

    Exploring a Rule File

    CityEngines rule system uses CGA code, a dedicated scripting language unique in CityEngine. Due to the fact that CGA is a scripting language, it offers the user a generic and flexible tool to create 3d models for all types of cities. From modern to contemporary, from ancient to futuristic: anythings possible!

    Lets explore the provided rule weve been using so far!

    Open the rule file by either double clicking the CGA rule file in the Navigator or use the Rule File link in the Inspector.

    The Rule Editor provides two different ways to visualize the rules: Textual and visually

    Toggle the different views with the following buttons in the Rule Editors toolbar:

    Most users prefer editing code as text. But to visualize the flow of the rules, the Visual CGA variation is obviously more intuitive.

  • 15

    Let us explore and edit how the building height is defined:

    Change the view to the Visual Rule Editor. Use the same Navigation as in the 3d viewport to pan and zoom in the Visual Rule Editor. Expand the Lot rule with the little v shaped icon on the top right corner.

    You will notice that the extrude operation is driven by the attribute height.

    Expand the attribute height too.

    Editing the Rule File

    Height is defined as a random value between 15 and 25:

    Change the height values to other values you like by clicking on the numbers and entering new values. Note the changes in the text editor after saving the rule file!

    Now, lets add a roof!

    Right-click on the grey canvas and add a new Rule, name it Roof.

  • 16

    Connect the Lot rules Shape named Shape with the Roof rule. A new grey connection line should get created. Note that the Shape priorly named Shape is renamed to Roof, now pointing to the rule called Roof.

    Right-click into the new Roof rules rule body, slightly above Shape. Add a new roofHip operation:

  • 17

    Your rule now should look like this:

    Once you have saved your rule, youre at the same state as the provided rule file called building_02.cga.

    Select your building again and generate it again. It now shows the geometry of a roof, which concludes this tutorial.

  • 18

    (Continue with the other Tutorials. Have fun learning CityEngine!)