Implementing mesh creation along splines in UE5 2-SplineMesh version

I wrote about the method of creating meshes along splines in a previous article:
https://blog.csdn.net/grayrail/article/details /130453733

However, this method does not have a mesh deformation operation, which will result in each mesh object being unable to be connected:
Insert image description here

Later I discovered that the SplineMesh method can solve this problem better:
Insert image description here
Therefore, this article will talk about how to create a continuous mesh through the SplineMesh component.


1.Operation process

First, a few concepts need to be mentioned again:

1.1 In UEConstructor can be executed in the editor. We'll wire up the logic for manipulating the splines in the constructor.

1.2 Components can be added dynamically through the Add xxx component node in the blueprint, for example as follows:
Insert image description here

1.3 The Spline Mesh Component cannot directly generate a complete spline model, but it can distort the model and use it in combination with the Spline component to finally obtain a complete spline model.

1.3 Finally, this can be achieved by dynamically adding Spline Mesh Component components to the two key points before and after the Spline component:
Insert image description here
Connect according to the above blueprint to achieve the effect in the gif.

2. Optimization

So instead of manually adding so many points to Spline, can we directly create SplineMeshComponent dynamically through distance interpolation? And based on Spline key points, it will also cause the model stretch distance to be uneven.

Currently, no simple and direct method has been found, but it can be solved by setting up 2 Spline components.
First, add 2 Spline components. Spline2 is responsible for resetting key points with equal distances according to the length of the Spline:
Insert image description here
Modify the node and add it in front Operation of transferring Spline data to Spline2:
Insert image description here

The links of the following nodes are similar to the previous ones:
Insert image description here
The final effect is as follows:
Insert image description here

Guess you like

Origin blog.csdn.net/grayrail/article/details/133747086