- Question -
I want to interact with the spatial mesh that I can access via MRTK. I want to instantiate a sphere at the cursor position and get every triangle of the spatial mesh that is inside of the sphere, so I can cut that out and save it for me.
I know how to
- instantiate and position the sphere
- get the spatial mesh via the scene understanding sdk
But I don't know how to approach this. To better understand what I want to try, I have drawn a small sketch:
- Solution -
- Get collided objects via
TriggerEnter & -Exit
- My sphere has the
object manipulation script
from MRTK, that has anEndOfManipulation-Event
that triggers, after placing the sphere. - Getting all
MeshFilter
andMeshes
- Check via collider.bounds.contains if point is inside my collider and save all those points to create a new mesh via the code from @Pluto.
- Combining meshes into one mesh and placing it somewhere