I need to find the number of polygons of a mesh. Unfortunately, the engine I use (Flare3D) doesn't seem to have such a property. In fact, each Mesh is simply consisted of Surfaces which have the badly documented following properties:
indexVector
numTriangles (=-1?)
polys (=null?)
sizePerVertex
vertexVector
I tried some combinations, e.g.
for each (var mesh:Mesh3D in meshes) {
for each (var surface:Surface3D in mesh.surfaces) {
tris += surface.vertexVector.length;
}
}
trace("tris",tris,tris/24);
and tris/24
seems to give the correct number of triangles but NOT for every model I tested...
EDIT:
numTriangles seems to be filled with the correct number of triangles after rendering is performed, but:
- It's render-based, I would like to find out without interfering with any rendering at all
- It reports number of triangles; the mesh may be consisted of quads and/or triangles!