Hello, I hope somebody can help me with this
I want to remove or delete triangles of a mesh object, more specific only the triangles are in Y = 0 position, here a imagen of what i mean
i dont want to use shaders with transparent, i need remove the triangles if its posible
thanks in advance
Well, if this is a mesh and not a terrain, just iterate through the triangles array, check which triangles have all vertices y == 0 and remove it. The easiest way is to but the indices into a List and iterate backwards:
// C#
Vector3[] vertices = mesh.vertices;
List<int> indices = new List<int>(mesh.triangles);
int count = indices.Count / 3;
for (int i = count-1; i >= 0; i--)
{
Vector3 V1 = vertices[indices[i*3 + 0]];
Vector3 V2 = vertices[indices[i*3 + 1]];
Vector3 V3 = vertices[indices[i*3 + 2]];
if (V1.y < 0.001f && V2.y < 0.001f && V3.y < 0.001f)
{
indices.RemoveRange(i*3, 3);
}
}
mesh.triangles = indices.ToArray();
Written from scratch, untested.