Is it possible to delete triangles?
Blitz3D Forums/Blitz3D Beginners Area/Is it possible to delete triangles?
| ||
Is it possible to delete triangles? Or delete all the triangles from a surface, without deleting triangles on other surfaces? |
| ||
No, you have to rebuild the mesh Andy |
| ||
You can however delete *all* triangles or *all* vertices or both (meaning you kill the surface) using the ClearSurface command. |
| ||
Or you can edit your surface texture and paint the area occupied by the triangle with a the mask color. depends on why you want to delete teh triangle |
| ||
Thanks everyone. :) I have a large, tiled map upon which I need to be able to highlight arbitrary tiles to show ranges of movement or areas of effect. I was hoping to avoid doubling my triangle count by having a second mesh/surface with a copy of all the vertices from the original map, but only creating the triangles I needed to display and removing them afterwards. Since it's not possible to delete individual triangles, my current solution is to create all the triangles and set their VertexTexCoords() to show only a masked area of my texture. Then, as needed, I modify their VertexTexCoords() to show a highlight texture. If anyone has a better approach, I'd love to hear about it! :) |
| ||
Use ClearSurface() to delete all the triangles, but not the vertices. Then build the desired triangles. |
| ||
Beautiful, thanks :) |