Fused_Point_Cloud Mapping in Unity

Hey
i want to create a fused point cloud spatial map in Unity. But no matter what i do it’s always a mesh spatial map.

In ZEDManager is
spatialMapping.StartStatialMapping(sl.SPATIAL_MAP_TYPE.MESH, mappingResolutionPreset, mappingRangePreset, isMappingTextured);
I tried FUSED_POINT_CLOUD instead of MESH, but that doesn’t work.
EnableSpatialMapping(type, resolutionPreset, rangePreset, isTextured);
If i understand it correctly type expects an Integer but where am i supposed to change it. I’m a bit lost.

Greetings
Steven

Hi,

You can use a script called “ZEDFusedPointcloudRenderer” to display the fused point cloud in the scene.
All you have to do is adding this script in your hierarchy, and press play.
You might also want to change the settings such as the point size or the resolution.

Best,
Benjamin Vallon

Hey Benjamin

thanks for the answer. Yeah i got that already but the problem is i need to work with the points after. I wanted to use a clustering algorithm, because i just need the point cloud of my object in the middle. But it seems like there are no point objects created or something.

Hi,

In the script, we retrieve the point cloud here, in an array containing all the points and their color. And then, we send it to the shader to render it (here : https://github.com/stereolabs/zed-unity/blob/master/ZEDCamera/Assets/ZED/SDK/Helpers/Scripts/Display/ZEDFusedPointCloudRenderer.cs#L183).

Here we use all the points retrieved by the SDK but you don’t have to.
You can remove all the unnecessary points from the array (called “vertPoints” in the script) before sending it to the shader.

Best,
Benjamin Vallon

1 Like