shown in other instead.
Generating Point Objects
Houses, landmarks, and other such objects are placed at specific points of the terrain. Two shape types can be selected from vector data sources (*.shp and *.geojson assets) and used for point object placement:
- Point — the primary object is placed at the position specified by the point and oriented the same way as when saved to a *.node file.
- Line — the primary object is placed at the position specified by the first point, while the second point determines the orientation of the object's forward direction vector (positive Y).
This chapter describes the general workflow for the generation of point objects on the terrain.
1. Preparing a Primary Object#
Create a primary object that will be used as a building block for the generation — any *.node file containing a single root node with any hierarchy.
2. Adding a Vector Data Source#
Currently, Sandworm allows using only offline vector data sources for the generation.
In the Sources panel, add a new vector data layer.
Clicking on Vector opens the window for adding Slots. Slots are designed to organize data.
- Clicking on + Add Layer provides the toolset for uploading vector data.
In the Parameters panel, define the type of Data Source to be used: Assets or External Files. Currently, only *.shp and *.geojson are supported as assets. Therefore, if you have other types of files, you can try to add them as External Files.
- In the window that opens, select the set of files to be used as vector data.
When the vector data is added, its image is displayed atop all the layers in the Preview panel (you may change the order of layers display by RMB click on a layer in the list of sources), and the Vector layer parameters become available.
3. Specifying Filters for Point Objects#
The Filter is a set of rules used to pick the specific data from the list of all available vector data. The rules are created using the Attributes — only the objects that fit the requirements of every Attribute are generated based on othis Filter.
Filters are created as follows:
Click the Add button in the Filters window of the Parameters panel.
Double-click on the Filter to specify a Filter name. To remove a Filter, use the Remove button. You can add as many Filters as necessary.
The Share button allows shared use of the Filter among vector data layers. Select the vector data layer that will share this Filter in the pop-up window. Changes in a shared Filter will be applied to it in all vector data layers.
- Select a slot from those created by you (Sources -> Vector).
For each Filter, set an Attribute (or Attributes) to filter certain data from the vector source. The required data is filtered using the Attribute values and a suitable operator. Autocomplete is available — you can type in Attribute names and values.
The available operators are: =, !=, >, <, ANY. ANY generates all the objects that have any value assigned for the selected Attribute.When using > and <, make sure that the selected Attribute type is a number. String comparison may cause issues.
You can also select Attribute values from the Attributes table. The table opens using the sign on the right of the Attribute expression.
Double-clicking on a value in the table adds it to the Attribute value field.
To add more Attributes, use the "+" (plus) button. You can add as many Attributes for one Filter as necessary. It is possible to set AND and OR relations between the Attributes in the Filter.
To remove an Attribute, use the button to the right of the Attribute expression.
4. Specifying Parameters of Point Objects#
In this step, we set objects that will be generated and placed across the terrain's surface according to the data filtered by the Filter.
On the Sources panel, click + Add Object.
In the drop-down, select the type of object you will generate according to the Slot data. In our case, it is Points. Click Import.
Set the following object parameters:
|Vector Slot||A Slot created by you to organize data using filters.|
|Object Name||The object's name that is displayed in the Objects list in Sandworm and in the World Nodes hierarchy when the terrain is generated.|
|Node||The path to the primary object's *.node file.|
|Use as Fence||Option for lengthy objects such as fences and pipes. When creating point objects, this option should be disabled.|
Flag indicating if collisions for the generated object are to be detected.
Available only for geometry type.
|Drop To Ground||Flag indicating if the generated object will be aligned with the terrain surface.|
|Height Offset (m)||
Distance from the terrain surface along the Z-axis, in meters.
If you see the generated object partially, You can try to increase this value to lift it above the terrain surface.
|Bake To Cluster||If enabled, bakes generated point objects to Mesh Cluster. If disabled, generated objects are added to the world hierarchy as NodeReferences.|
|Forward Axis||Axis which determines the orientation of the primary object: X, -X, Y, -Y.|
|Split Billboards Length (km)||
This parameter is required if your primary object is a billboard, to control the number of Billboards objects to be generated due to area splitting:
The maximum number of billboards contained in a single Billboards object is limited to 8000. Thus, the number of generated Billboards objects is also affected by the total number of points, where the Billboards are to be placed. Although Billboards are performance-friendly, generating too many of them may reduce performance.
If you introduce any changes to created objects, click Apply to update them immediately.
5. Generating Point Objects#
If the terrain has already been generated and you made no changes to it, you can regenerate only the vector data. In the corresponding settings, disable the data types you don't need to be regenerated.
Here is a terrain fragment with houses generated based on vector data using the primary mesh object: