This post describes how to create a fence using the built-in fence constructor. Presentation video.
Prepare 3D models
You need to prepare 3D models, this post does not describe how to import 3D models.
We have two meshes for post and panel of the fence. The post is a point on the curve of the fence, the panel is the barrier between points.
- The meshes must be aligned along X axis.
- The pivot of the post must be on the center bottom.
- The pivot of the panel must be on the side bottom.
The post:
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719852566-283237-fence1.png)
The panel:
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719852639-437425-fence2.png)
Configure collision bodies. Because the fence is not solid, to a collision body the Mesh Worst LOD mode is used.
Read more about collision bodies.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719852917-914177-fence3.png)
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719852922-335702-fence4.png)
Configure fence type
To create a new fence type, select the destination folder in the Resources window, click the right mouse button to open the context menu. Go to New Resource -> Addons -> Fence -> Fence Type.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719865073-438004-fence5.png)
In New Object dialog specify the name of the fence type. Click Create and Close button.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719865078-793051-fence6.png)
You will see a new created file in the Resources window.
At the right, in the Settings window, click on the Reference button for End Post property.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719865083-38017-fence7.png)
In the opened window select Post.gltf, click Set and Close button.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719865085-853244-fence8.png)
You will see the meshes in the workspace. Configure other properties Line Post, Corner Post, Step Post. Set all to Post.gtlf.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719865088-795878-fence9.png)
Next, configure panel mesh by means Full Panel property and the length of the panel by means Panel Length property.
Click Save, now the type is ready to be placed in the scene.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719865091-587088-fence10.png)
Placing in the scene
Select the fence type file in the Resources window, drop it to the workspace of the scene.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719866478-920097-fence11.png)
You can transform points of the fence.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719866483-279842-fence12.png)
To add new point you can clone another, use Move with holding Shift key.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719866486-844349-fence13.png)
The result.
![](https://forum.neoaxis.com/assets/files/2024-07-01/1719866490-347760-fence14.png)
Per point settings
For each point of the fence can be configured separately. For example, you can hide the panel between two points.
![](https://forum.neoaxis.com/assets/files/2024-07-02/1719950018-413562-fence15.png)
Fence entrance
See also
WIP