- Home /
Best Way to Link Vertices into Mesh
Hey there,
What is the best way to take a bunch of vertices defined in an array, and make them into a mesh. I've managed this with simple things such as a plane and a cube, however I'm interested in making more complex meshes so I can make a terrain with caves etc. I don't understand how you can make a script automatically work out the best way to link the vertices into a clean mesh.
There's no way. How should the script know which three vertices should make up one triangle? You have to assign the triangles yourself. Basically, you would think about where a polygon needs to be, then assign the Vector3 coordinates for the vertices, and then connect these vertices so you get one or more triangles with the correct normals.
So how do people make smooth voxel terrain like this?
https://www.youtube.com/watch?v=xybv-aldhtI
I'd say they have a bunch of cubes and create a mesh over the top then delete the cubes? In that case they would have to be using some script to deter$$anonymous$$e where the triangles go right?