This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
Content Optimization
Materials
Material Nodes Library
Art Samples
Tutorials

生成点对象

警告
本文介绍的功能在 Community SDK 版本中不可用。
您应该升级到 Engineering / Sim SDK版本才能使用它。

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:房屋、地标和其他此类对象放置在地形的某些点上。有 2 种形状类型可以从矢量数据源(*.shp*.geojson 资产)中选择并用于点对象放置:

  • 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.Point — 在这种情况下,基本对象将被放置在点指定的位置,并且其方向与保存到 *.node 文件时相同。
  • 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).Line — 在这种情况下,基本对象将放置在第一个点指定的位置,而第二个点确定对象的前向矢量(正 Y)的方向。

This chapter describes the general workflow for the generation of point objects on the terrain.本章介绍了在地形上生成点对象的基本工作流程。

注意
The article assumes that you have already added the data required for the terrain surface.假设您已经添加了所需的数据地形表面.

1. 准备一个基本对象#

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.创建一个将用作生成构建块的基本对象——任何包含具有任何层次结构的单个根节点的 *.node 文件。

注意
The primary object must be located and have a pivot at the origin (0, 0, 0).必须找到基本对象并在原点 (0, 0, 0) 处有一个枢轴。

Export your node to a .node file.将您的节点导出到 .node 文件.

2. Adding a Vector Data Source2. 添加矢量数据源#

Currently, Sandworm allows using only offline vector data sources for the generation.目前,Sandworm 只允许使用离线矢量数据源进行生成。

  1. In the Sources panel, add a new vector data layer.Sources 面板中,添加一个新的矢量数据层。

    • Clicking on Vector opens the window for adding Slots. Slots are designed to organize data.点击 Vector 打开添加插槽的窗口。槽被设计成将数据组织到不同的地形掩模中。

      Slots

    • Clicking on + Add Layer provides the toolset for uploading vector data.点击 + Add Layer 提供了上传土地覆盖数据的工具集。
  2. 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.Parameters 面板中,定义数据源类型使用:AssetsExternal Files。目前仅支持 *.shp*.geojson 作为资产。因此,如果您有其他类型的文件,您可以尝试将它们添加为 External Files

    Click Import.单击 Import

  3. 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 Objects3. 指定点对象的筛选器#

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. Filter 实际上是一组规则,用于从所有可用矢量数据的列表中挑选特定数据。规则是使用 Attributes 创建的。只有符合每个属性要求的对象才会基于此过滤器生成。

Filters are created as follows:过滤器创建如下:

  1. Click the Add button in the Filters window of the Parameters panel.单击 Parameters 面板的 Filters 窗口中的 Add 按钮。

    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.双击过滤器以指定过滤器名称。要删除过滤器,请使用 Remove 按钮。您可以根据需要添加任意数量的过滤器。

    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.Share 按钮允许在矢量数据层之间共享使用过滤器。在弹出窗口中选择将共享此过滤器的矢量数据层。共享过滤器的更改将应用于所有矢量数据层

  2. 从您创建的槽中选择一个槽 (Sources -> Vector)。槽被设计成将数据组织到不同的地形掩模中。
  3. 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.可用的运算符是:=, !=, >, <, ANYANY 生成为所选属性分配了任何值的所有对象。

    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.双击表中的值将其添加到属性值字段。

  4. 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.要添加更多属性,请使用“+” (加号)按钮。您可以根据需要为一个过滤器添加任意数量的属性。 可以在过滤器中的属性之间设置 ANDOR 交互。

    To remove an Attribute, use the button to the right of the Attribute expression.要移除过滤器,请使用属性表达式右侧的 按钮。

4. Specifying Parameters of Point Objects4. 指定点对象的参数#

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.在这一步中,我们将根据过滤器过滤的数据设置将生成并放置在地形表面的对象。过滤器.

  1. On the Sources panel, click + Add Object.Sources 面板上,单击 + Add Object.

  2. 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.在下拉列表中,根据槽数据选择要生成的对象类型。在我们的例子中,是 Points。单击 Import

Set the following object parameters:设置以下对象参数:

Slot 由您创建的用于组织数据过过滤器的槽。
Enabled 当打开时,将生成这种类型的对象。关闭时,这种类型的对象不会生成,也不存在于包含生成的地形的世界中。
Node The path to the primary object's *.node file.通往基本对象*.node 文件。
Use as Fence Option for lengthy objects such as fences and pipes. When creating point objects, this option should be disabled.选择长对象,如栅栏和管道。当创建点对象时,应该禁用它。
Collider

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.沿 Z 轴距离地面的距离,单位为米。

注意
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.如果启用,将生成的点对象烘焙到 Mesh Cluster。如果禁用,生成的对象将作为 NodeReferences 添加到世界层次结构中。
Forward Axis Axis which determines the orientation of the primary object: X, -X, Y, -Y.确定基本对象方向的轴: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:这个参数是必需的,如果你基本对象是一个广告牌,用于控制由于区域分割而生成的广告牌对象的数量:

  • Low values will increase the number of generated Billboards objects.低值将增加生成的 Billboards 对象的数量。
  • High values will reduce this number.值会减少这个数字。
注意
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.单个 Billboards 对象中包含的最大广告牌数量限制为 8000。因此,生成的 Billboards 对象的数量也受要放置 Billboards 的点总数的影响。虽然 Billboards 对性能很友好,但生成太多可能会降低性能。

If you introduce any changes to created objects, click Apply to update them immediately.如果您对创建的对象进行了任何更改,请单击 Apply 以立即更新它们。

5. Generating Point Objects5. 生成点对象#

Now you need to configure the output settings and generate (or regenerate) the terrain which contains these vector objects by clicking the Generate button.现在你需要配置输出设置产生(或者再生) 通过单击 Generate 按钮包含这些矢量对象的地形。

Here is a terrain fragment with houses generated based on vector data using the primary mesh object:这是一个地形片段,其中包含使用基本网格对象根据矢量数据生成的房屋。

最新更新: 2021-09-30
Build: ()