Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

SurfaceMeshesToPlanes and RemoveSurfaceVertices

advice needed for these few questions:
1. planes created for floor surfaces using SurfaceMeshesToPlanes.cs are not really accurate. they tend to be 5-10cm above the real ground. anyway to prevent this?
2. I don't really get how the RemoveSurfaceVertices.cs works. example, how do I remove wall vertices so that only the floor gets mapped?

thx in advance!

Answers

  • Hi @felsiska,

    1. The SurfacePlane prefab which is used by the SurfaceMeshesToPlanes script is a cube with the transform at the center of the object. The cube will be created around the surface mesh, and since it has some thickness, there will be a portion of the cube created above and below the mesh. You could set the 'Plane Thickness' property on this prefab to minimize this effect. You can also create your own SurfacePlane prefab (replace the cube with a plane), if you want to create something more flush with the surface, or introduce a segmented/mesh plane instead. Also, keep in mind that the meshes created via Spatial Mapping are not always flush with the surface, so you might have to take a longer time scanning your environment to get a more accurate rendition of the world.

    2. With RemoveSurfaceVertices, you send a collection of bounding objects to the script. Any vertices that fall within the bounds of the collection will be removed (note: there is currently a bug in the Spatial Mapping course version of this code where it does not convert the bounds to world coordinates first, so I'd suggest using the latest HoloToolkit version when using this script). Bounding objects can be spheres, cubes, etc. This process can be expensive to run and takes many frames to complete, so it's better to use this script when you want to insert a few holes in the environment, rather than remove large chunks like we do in the course. If you're using PlaneFinding and you don't want walls at all, then you can set the 'Destroy Planes' property on the SurfaceMeshesToPlanes component to 'Walls' and no planes will be created for them. Otherwise, you can query the 'Active Planes' object for a collection of 'walls' and then send them to RemoveSurfaceVertices as the bounding collection, this will remove any vertices from the spatial mapping mesh that happen to fall inside of the wall planes. You might need to increase the 'Bounds Expansion' property to account for some vertices that float outside of the bounds of the plane (especially if you minimized the thickness of the SurfacePlane prefab or replaced the cube with a plane).

    I hope this explanation helps,
    ~Angela

  • @ahillier
    thx for the detailed explanation.

    roughly understood the whole idea of RemoveSurfaceVertices. but how do I set the 'walls' bounding objects? not very sure how to execute this part:

    Otherwise, you can query the 'Active Planes' object for a collection of 'walls' and then send them to RemoveSurfaceVertices as the bounding collection, this will remove any vertices from the spatial mapping mesh that happen to fall inside of the wall planes. You might need to increase the 'Bounds Expansion' property to account for some vertices that float outside of the bounds of the plane (especially if you minimized the thickness of the SurfacePlane prefab or replaced the cube with a plane).

    is there any alternative ways other than removing the whole chunk of walls? i'm trying to achieve something similar to the 'lock to floor' effect in 3D viewer beta, where only the floor is mapped, and has a single 'plane' across.

Sign In or Register to comment.