you might want to look into splines, i haven’t used ThreeJS SplineCurves yet but in Unreal that’s what i use in level design to bend meshes like a bridge or a pipe.
You can create a plane which width will the same as the number of widht segments. Then vertices x coordinates will an integers, and this values сould be used as indeces to set its realy x and z coordinates from the 2d-spline. If you want to do it in the vertex shader, you can attach a spline coordinates as a texture.
Thank you man this is what I need, I manage to replicate this in the vertex shader since I need it in the vertex , it works perfect with one mesh but I can’t figure out the math for multiple meshes to stay connected
@Tibi
I see no difficulties to achieve the desired result, using vertex shader. @trueshko gave you a nice hint about to put spline data into DataTexture.
Ok guys I almost did what I needed but I can’t figure out how to calculate the plane with in the fragment shader so that the meshes are arranged correctly with no gaps … thank you
So what I can’t figure out is how to perfetly align the mehes on the curve with no gaps and also to be able to add more and they shuld just continue on the right and left, I hope it makes sense.
Thank you sooo much, I will start digging into this but it looks like what I need.
If you have time can you address the number of mehes basically if I add for example 20 meshes they should remain at the same size visually now the entire curve scales, this is what I could not solve, and put me on hold.