Hello all,
I am trying to connect some generated points to form a mesh, but despite my best efforts to try and understand how to piece the mesh and triangles together, I’m still struggling!
The image below is composed of an array, ‘vertices’, that I wish to connect. The points consist of a ‘torus_count’ number of points in a torus before moving to the next one along. This is best illustrated by the diagram below. I have also included the code in the OnGUI section which enabled me to produce this diagram.
In short, what is the best way now to go from here to generating a mesh array and a triangles array?
Many thanks,
Popuppirate
Code:
void OnGUI (){
for (int i=0; i<vertices.Length; i++) {
if (i < vertices.Length - torus_count)
{
if (i % torus_count == torus_count-1)
{// Draws last line of each section
Gizmos.DrawLine(vertices*, vertices[i + torus_count]);*
continue;
}
Gizmos.DrawLine(vertices*, vertices[i + torus_count]);
Gizmos.DrawLine(vertices[i + torus_count], vertices[i + torus_count+1]);
Gizmos.DrawLine(vertices[i + torus_count], vertices[i + 1]);
_Gizmos.DrawLine(vertices[i + 1], vertices);
}*_
}
}
[58072-screenshot-2.jpg|58072]