Triangles in a mesh have no associated data that you could use to identify them, so you can’t easily retrieve a group of triangles. The only way is to know the triangle (face) indices.
The easiest way would be to export each group of faces as a separate mesh.
If I understand you correctly, there is no easy way for me to make a selection of these polygons (triangles) in Babylon?
I can Assign different materials to the polygons but I cannot select them?
I must say its surprising to me as this is prettty basic…
Breaking it into different meshes is not a good option for me as I need it to remain 1 mesh.
Is there no other simple workaround to easily select specific polygons (triangles)?
If it matches there are ways of selecting the triangles, if not it would be complicated…And it look basic but it’s not , because there’s no triangle informations in the geometry files (gltf, obj, etc.).
I believe you could take advantage of this as a go-around (since, no, there is no polygon group selection in BJS). But there’s cloning of materials and texture and you can also dispose of them and replace them.
If you’d assign a cloned material to your poly-selection, you can next search it through the material id. Since it’s not a unique id, you can even assign a same id to different materials to form ‘groups of poly-selection’ or even better you can add an identifier to each id for different purposes and next split the id to transform a group that contains a same identifier. After the process is done, you could simply assign the final material to all and dispose of those that are just duplicates. I know it’s not ideal. It’s a work-around but I believe it should still be manageable.
Edit: I realize my answer is just ‘high-level’ and may not be applicable. May be you could tell us a bit more about what you want to do with these ‘polys-selections’? It will only make our answers more accurate.
It’s basic in a 3D modelling app but not necessarly in an engine. Though, I’m not saying, improvements can still be made (and are made every day) and now with i.e. ray marching and the new stuff, may be one day in a near or less near future, it will enter the list of potential improvements (just a guess). Meanwhile, I believe we need to make with what’s available and there’s nearly always a solution as a work-around. May be not always the one we would have wanted but yes, that’s what it is I suppose
If you can’t solve a problem from the right side, it’s best to look at it from the other side to at least come up with a new approach.
How can you assign multiple materials to an object in Babylon? Via subMeshes!