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.
Options

floor spatial mapping

felsiskafelsiska
edited November 2016 in Questions And Answers

I'm trying to map only the floor and remove all other vertices other than floor. similar to 3d viewer beta lock to floor scenario. but how do I search for the spatial mesh for the vector that has lowest Y value and an up vector? grateful if anyone could guide me.

Tagged:

Answers

  • Options

    @felsiska ,

    Finding plane meshes that are floors is built into the HoloToolkit (which is considerably easier than trying to do it by hand since these spatial understanding scripts call a C++ dll).

    You can find sample code in HoloToolkit\SpatialMapping\Tests\Support\SpatialProcessingTest

    For a fuller example you should refer to the Spatial Understanding Feature Overview Example in HoloToolkit-Examples and specifically take a look at the LevelSolver class: HoloToolkit-Examples\SpatialUnderstanding\SpatialUnderstanding-FeatureOverview\Scripts\LevelSolver.cs

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • Options

    @james_ashley
    thx for the advice. roughly understood spatialProcessingTest but not LevelSolver. please correct me if I'm wrong. spatialProcessingTest uses SurfaceMeshesToPlanes to find the appropriate mesh positions and load a plane prefab through SurfacePlane. I can use SurfaceMeshesToPlanes to load planes only onto the floor. but the other vertices will cause objects to collide. or is there any way that I can disable spatial mapping after planes have been created?

  • Options

    @felsiska,

    You've got it. Then to ensure that only floor planes are created, you can set the mask property of SurfaceMeshesToPlanes like this:

    surfaceToPlanes.drawPlanesMask = = PlaneTypes.Floor;

    this filters the plane types that can get instantiated.

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • Options

    @james_ashley
    understood. is there a way to disable the spatial mapping when clicking on maybe a button? I do not want objects to collide with other vertices.

  • Options

    @james_ashley
    also, the floor planes are 20-30cm higher than real floor surface. I've deleted the room meshes and recalibrated but still have this problem. any suggestion?

Sign In or Register to comment.