Complex geometry - Intro I.

Complex geometry - Generating terrain - Generated set I - Generated set II

In addition to modeling based on general geometry, we often encounter situations where we need to use our shapes in wider context of modeling. To do this, you can use the modifier tools category, here in the CaZaBa program called as Complex geometry. We find it on the left panel of the Complex geometry tab next to Cameras / Lights, 3D bodies, and 2D bodies.

Complex geometry

When you open the drop-down menu on the Complex geometry tab, you'll see a number of features. All of these features are described in detail in the documentation included with the installation of the program. All of them can help us to create quickly and easily much more complex models simply by setting a few of their parameters. For example, let's consider the scenery of the city, where it is necessary to create terrain relief and distribute buildings on it, and all with some randomness, to produce the naturally looking result. Each building and every detail could be set individually, but it would be too long and laborious. In the following two tutorials we will show you how to do everything much faster.

For the following work again download here the necessary resources to not start completely from scratch. The archive features a model of a residential building, a skyscraper model, textures for them, and the texture of the city surface and texture for the highway.

Generating terrain

First we will create a terrain on which the city will stand. The terrain model itself always needs some input model according to the shape of the resulting terrain. So it hasn't to be just a plane, but a Cylinder, Elipsoid or any other shape. For our city we need a input model, which will be the Panel from the 3D bodies tab, which we set as follows:

  • X: 100
  • Y: 100
  • Seg X: 20
  • Seg Y: 20

Now to the terrain itself. On the Complex geometry tab of the left panel, select Terrain and press the Create button. Apparently nothing appeared, but that's not true. The terrain generator was created empty because it first needs to know the shape of the terrain to generate at and how. If the terrain model is still selected, several relevant parameters are displayed in the lower half of the left panel. The first parameter is Input model. Click on its [...] button and in the following list of models select the Panel that we created a while ago.

Leave the TexCoord parameter unchanged. In order for this function to generate the terrain on any shape, it uses the surface mapping coordinates instead of spatial coordinates. So if we change the mapping of vertices in one UV layer, we can choose one of the other UV layers to generate the terrain. Set the other parameters to create a slightly curved terrain. Maybe as follows:

  • Terrain type: Hills 1
  • Frequency X: 13
  • Frequency Y: 13
  • Offset X: 5
  • Offset Y: 1
  • H: 1
  • Terrain offset: 0
  • Lakcunarity: 1,5
  • Amplitude: 3
  • Iteration: 5

Once the terrain is set, we see that a new panel has appeared in the space, deformed according to the above mentioned parameters. So far, there is no material, so we can setup one. On the toolbar, press Materials to open the material palette. Click the Diffuse button bellow the gray box row in the first material. The diffusion texture settings dialog opens, where you click the Open... button and locate the Citybed_01.png texture that we downloaded above. Close the diffusion texture window again. For this material, we'll further set a very gentle glare by setting Specular exponent to 10. Double-click on the color square of the Specular component of the material to open its settings and set its color to RGB = 3;3;3 (almost black). If the terrain model is still selected, we now assign the material to them by pressing the Add button.

Generated set I

Now, in our city model, we will create residential buildings. To do this, we can use the function from the Complex geometry tab called Generated set, to help distribute copies of the element model on the surface of another model. Just like the terrain generating function, it does not have any form until it gets the input model - houses models. So let's import houses models that you downloaded with all the resources for this tutorial.

Use option Model - Import... to locate the models Condo.obj and Skyscraper.obj (need to be imported individually). Caution: When the program prompts you to import the materials, select NO. This is because the import of materials would always overwrite the palette of current ones, including the material for the generated terrain that we have already set. We set the house materials manually as follows:

Material Condo:

  • Diffuse texture: Condo_01.png
  • Specular exponent: 5
  • Specular component (double click on color square): 64;64;64
  • Other values: default

Material Skyscraper:

  • Diffuse texture: Skyscraper_01.png
  • Specular exponent: 5
  • Specular component (double click on color square): 64;64;64
  • Other values: default

Same as in the case of terrain, select each house model sequentially and in the Materials palette assign the corresponding material to them by pressing the Add button.

Now we are finally going to generate. On the Complex geometry tab, select Generated set and press Create button. The new model is empty again because it expects several input models. The first is the Model of normals. This one tells us both the original shape and the direction in which the normal vector of each vertex is oriented, according to which the distributed element model is oriented. Here choose the original Panel. Another input model is the Model of heights. This is a real relief, and there belongs the Terrain model to be set. The last is the Element model, which means that its copies will be placed on the surface, and it will now be the Condo model.

Set other parameters as follows:

  • Elements count: 400
  • Height scatter: 1,000
  • Scale scatter: 1,500
  • Other values: default

Tip: Generating elements in the Generated set is controlled by the pseudorandom numbers function. This is based on the Seed value. If you want elements to be generated in a different sequence, you can try setting Seed other than zero.

As you can see, the function will deploy 400 houses, varying in locations above terrain up to +/- 1 unit and up to +/- 50 percent in the scale. Next, we can see that if the Element model has had assigned some materials, the Generated set function automatically adopts them on itself. Caution: Generated set is a stand-alone model. In order to be correctly positioned on the terrain according to which the Generated set is created, must both be located at the same point in the space.

Generated set II

We'll use the Generated set again, but with slightly different settings to deploy skyscrapers. While residential houses make up the majority of the city, skyscrapers are often placed in a clustered group in the downtown. Create the new Generated set as described above. Now assign the Skyscraper model to it and set the following parameters:

  • Seed: 24
  • Elements count: 20
  • Generate pockets: checked
  • Pockets count: 1
  • Pocket radius: 24
  • Height scatter: 1,000
  • Scale scatter: 1,500
  • Other values: default

Compared to the first Generated set, we have now used Generate pockets parameter. In conjunction with the value Pockets count the function first generates points on the surface of the terrain around which the Element model is then deployed. This makes it possible to generate a variety of similar group formations such as skyscrapers or forests, shrubs, stones, etc. As we turned on the Generate pockets and set Pockets count = 1, only one group of skyscrapers was generated. If we choose a different number of pockets, such as 3, three groups are created in our scenery and so on.

Tip: When working with the Generated set, we passed the Vertically to surface parameter. It is actually a switch that tells if Element models are to be oriented according to the normal vector of the Model of normals, i.e. perpendicular to the horizon, or Model of heights i.e. perpendicular to the surface at that point.

To continue, please open the Complex geometry - Intro II. tutorial.

<< Return to topics

Copyright (c) 2013 - 2019

General terms and conditions

End user license agreement