- Home /
how to connect and triangulate drawlines?
How can I sequentially connect a list of objects within an array? example: I have 12 objects (it is not a fixed amount), and I would like to connect the first (Length [0]) with the next (1), and the 1 with the next (2), and then return to [0] to form a triangle . and so with the others, (2-> 3, 3> 0 - 3-> 4, 4-> 0) and so on.
it had occurred to me to create a script for each object, and that object is connect with the previous one and with the 0. but unfortunately, the current int in which the script is not recognized.
I have a script with a list of objects (gameobject []), what I would like to know is how I identify in another script, what the object number is. if the script is inside object 4, that the "current" int to recognize that object, is the value of the object (4), among 150 more objects.
any ideas?
Answer by UnityCoach · Sep 29, 2018 at 06:18 PM
Have a look at the Mesh class documentation. It features everything you need.
yes, at the moment, I am creating trangules by coordinates, but I can only triangulate 4 points, (initial, old, previous and current) there I see an image that works, but not if I add a point as coordinate, there would be 2 old points, initial, previous and current.
that is why I ask how to connect with other previous points, to create a mesh, dynamically by points.
it can be seen that the more points, the triangles always remain between start, old, old and new. and the other disappears ..
It must be a simple calculation, but it can not be solved..
Your answer
Follow this Question
Related Questions
How do i create a Mesh in the middle of a Catmull spline? 0 Answers
Problem Creating a 2D Mesh 1 Answer
Distribute terrain in zones 3 Answers
Best way to optimize mesh updating through code? 1 Answer
How does the Triangles work on Mesh? 1 Answer