- Home /
Mesh between lines - Mesh.SetIndices
Hello,
I lines like the ones in the image below, and I would like to create a mesh that has the form of the surface between them. I already created a cube from code, so I know about tris. But in that case, I don't know how to do this. It's not only tris, it's a bit tricky. Can anyone give me some advice? Plus ... Can I use Mesh.SetIndices for this? I have found it about the question of another user, but I don't know how to use it.
Lines:
Answer by Bunny83 · Aug 14, 2020 at 06:17 PM
Wwll, it doesn't really matter if you use SetIndices or just triangles unless you want to use a different topology. However triangles are the most flexible shapes since the triangle is the simplest shape possible.
How to create your triangles depends on how you specified your vertices. Since that's all information that we do not have it's pretty pointless to give any examples. I would recommend to draw a simplified version on a sheet of paper and see if you can find a logical pattern depending on your vertex layout. From your image it's hard to tell if the two "curves" have the same vertex count. They look like they are the same curve just 180° rotated.
Though it's not clear if you only talk about your specific case or a more general case with a complete asymetric shape. In this case you might want to have a look at the triangulator script on the wiki.