How to get usable data from VertexPositions of SpatialMeshBuffer ?
Hello,
What I want to do is to get the position of a real surface based on the position of the device. For example, if there is a surface 2m right in front of me, I want to get a list of float3 representing the surface's meshes with z = -2.0f.
Why I want to do that is I because detect targets with the IR camera display and I want to put spheres where they are in space. I only need the distance between the device and the nearest surface detected on the position given by the target on the IR display.
I can get surface's meshes thanks to a SpatialSurfaceObserver, which I managed to use. I get a list of SpatialSurfaceMesh.
Now, I want to get the position of every mesh in a float3 format.
SpatialSurfaceMeshBuffer.VertexPositions() is the solution, but it gives me a SpatialSurfaceMesh, from which I can get an IBuffer.
Now, I have no idea how to convert the IBuffer to a list of coherent float3.
Can you please help me with that ?
Thank you !