添加管道、围墙、电线
Fences, pipes, and similar objects are placed along line segments selected from vector data sources (*.shp files). You can also simulate aircraft warning lights (in this case Billboards is used as the basic object).栅栏、管道和类似的对象放置在线段所选矢量数据来源(*.shp文件)。您也可以模拟飞机警告灯(在本例中广告牌作为基本的对象)。
In this chapter, let's create lights using the Billboards object and place a fence along a road.在这一章,让我们创建灯光使用Billboards对象和地点沿着道路栅栏。
See Also另请参阅#
观看这段视频,来自Sandworm地形生成系列视频教程:
Preparing a Primary Object准备一个主要对象#
A primary object to be used for the generation should be a *.node file (Node Reference) containing a single root node with any hierarchy.主要对象用于一代应该是*.node文件(Node Reference)包含一个根节点的层次结构。
Preparing Billboards准备广告牌#
- Create a Billboards: click Create —> Billboards —> Base on the Menu bar.创建一个Billboards:单击菜单栏上的Create -> Billboards -> Base。
-
Inherit the surface material and enable the Emission state. You can change the emission color and any other parameters in the Parameters tab.继承表面材质和使Emission状态。您可以改变发射颜色和任何其他参数Parameters选项卡。
- Export the object to a *.node file.将对象导出到 *.node 文件。
Now that the primary node (the *.node asset) is ready for use, you can disable it or delete from the scene.现在,主节点(*.node资源)是准备使用,您可以禁用或删除从现场。
Preparing Fence准备栅栏#
An important issue about placing objects along the lines is the node's pivot point: it should be shifted, if you want a fence to be generated near the road, not in the middle of it. To do this, open the asset in a third-party Digital Content Creation software.关于放置对象的一个重要问题是节点的轴心点:它应该改变,如果您想要一个栅栏附近生成路,不是在中间。要做到这一点,打开资源在数字内容创建一个第三方软件。
The width of the plane that we created for the road is 10 units, therefore we need to move the fence more than 5 units from the pivot, so that it wouldn't be on the road.我们为道路创建的平面宽度是10个单位,因此我们需要将栅栏从支点移动5个单位以上,这样它就不会在道路上。
The reimported model will look as follows:重新导入的模型如下所示:
Placing Points放置点#
Placing Billboards放置广告牌#
In Sandworm, create a Point object and add the data source.在 Sandworm 中,创建一个 Point 对象并添加数据源。
As we are going to place billboards along the road, let's use sw_georeferenced/vector/roads.shp file as the vector data source.我们要沿路的广告牌,我们用sw_georeferenced/vector/roads.shp文件作为矢量数据源。
- Select the created Node Reference as Node.选择创建的Node Reference作为Node。
- Enable the Use as Fence option.使Use as Fence选项。
- Disable the Autosize option.禁用Autosize选项。
- Set 5 as the value for the Step parameter that determines the distance (in units) between the two adjacent lights (Billboards) placed along the road.5设置为Step参数的值决定之间的距离(单位)两个相邻的灯光沿着路(Billboards)放置。
- Click the Create Point Object button.单击Create Point Object按钮。
The generated lights will look as follows (if you disable the sun light):生成的 灯将如下所示(如果禁用太阳光):
Placing Fence放置围栏#
In Sandworm, create a Point object and add the data source.在 Sandworm 中,创建一个 Point 对象并添加数据源。
As we are going to place a fence along the road, let's use sw_georeferenced/vector/roads.shp file as the vector data source and set a filter. Placing fences along all roads might be not very performance-friendly.由于我们要在道路上放置围栏,让我们使用 sw_georeferenced/vector/roads.shp 文件作为矢量数据源并设置 过滤。 在所有道路上放置围栏可能对性能不太友好。
Let's set the same filter as for roads:让我们为道路设置相同的过滤器:
And set the following parameters for the object:对象并设置以下参数:
- Select the created Node Reference as Node.选择创建的Node Reference作为Node。
- Enable the Use as Fence option.使Use as Fence选项。
- Click the Create Point Object button.单击Create Point Object按钮。
The generated fence will look as follows:生成的 栅栏将如下所示:
You can modify the cluster manually, but keep in mind that if you regenerate the object all manual changes will be lost. A solution may be to clone the edited object and move outside the Terrain hierarchy.您可以手动修改集群,但请记住,如果您重新生成对象所有手动更改将丢失。一个解决方案可能是克隆编辑对象和离开Terrain对象的层次结构。
What Else还有什么#
- Read more about the points parameters.阅读更多关于点参数。
- Read more about the filter settings.阅读更多关于 过滤器设置。