Ok, I have some information to get the vertices that is something like this:
and some vertices(that means that some vertices wasn't added to this variable)are added to a variable
and I have a variable(j) that increments(j++;). And when it ends to check all the triangles I put something like this: mesh1.vertices = newvertices;
this is my code:
what I am trying to do with this script is to find the vertices that have to be remove and like that have, first a list of vertices(already done and works perfectly), and second build triangles, and this is the part I need help. Help that works :P
I guess you don't understand what a vertexbuffer and a indexbuffer is?
A simple example for a plane:
Look carefully at the example of the indices. The first and the third vertex is shared between both triangled.
If you want remove some triangles you have to remove the 3 corresponding indices that made up the triangle. The resulting indices array will be smaller in the end. That's tricky because you can't change the size of builtin arrays dynamically. If you want to remove vertices somewhere in the middle of the vertices array it gets really difficult because the indices would be pointing to the wrong vertices.
I still don't know exactly what you want to do. I'll hope you understand everything i explained here. Maybe you can specify you question a bit and tell us what you want to archive.
I guess you've tried something similar in this post, right?
Ok, i still don't understand what exactly you want to archive :D
You said how to "find" a triangle. The loop where you increment your "j", it already goes through all triangles. "j" is the current triangle and (j*3), (j*3+1) and (j*3+2) are the 3 points that define this triangle.
If you want to remove a single triangle you have to copy all triangle indices into a new array except those you don't want. You can't change the size of a builtin array. The new arraysize have to be reduced by 3.