Selection with custom mesh

My project has N number of different convex polygons; they are large in number and can vary per frame.

To render them, I use the geometry batching technique. I created a custom mesh and loaded multiple polygon vertices into it. The geometry primitive are BABYLON.Material.TriangleFillMode(triangle lists) and BABYLON.Material.TriangleStripDrawMode (triangle strips with primitive index).

I have created an example here where I use Ray picking. My model has three triangles geometries in a single mesh object.

In the above example, only one triangle got selected it seems. Is there any technique where I can perform a selection on all three geometries within a single mesh object?

No, it’s currently not possible because we don’t support reporting multiple intersections within a single mesh (the Scene.multiPick / multiPickWithRay methods can report multiple intersections but for multiple meshes, each mesh can only report a single intersection).

It could probably be possible, but it would require a bit of refactoring…

1 Like

Thank you @Evgeni_Popov I will close this issue.