using Spatial Mapping to recognize a pre-scanned space

The Holograms app will recognize the space you are in if it has previously been scanned and cached. Is there any way to replicate this behavior with a mesh that has been scanned, downloaded and made a part of the Unity project for my app?
I need to be able to position objects in a pre-determined and scanned location but I can;t be sure where the user will be exactly when the app is launched.

Thanks

Best Answer

Answers

  • JasonJason ✭✭

    Hi @Plus2019, check out this info regarding the Emulator:


    https://developer.microsoft.com/en-us/windows/holographic/using_the_hololens_emulator

    Room tab
    The emulator simulates world input in the form of the spatial mapping mesh from simulated "rooms". This tab lets you pick which room to load instead of the default room.

    Simulated rooms are useful for testing your app in multiple environments. Several rooms are shipped with the emulator and once you install the emulation, you will find them in %ProgramFiles(x86)%\Program Files (x86)\Microsoft XDE\10.0.11082.0\Plugins\Rooms. All of these rooms were captured in real environments using a HoloLens:

    DefaultRoom.xef - A small living room with a TV, coffee table, and two sofas. Loaded by default when you start the emulator.
    Bedroom1.xef - A small bedroom with a desk.
    Bedroom2.xef - A bedroom with a queen size bed, dresser, nightstands, and walk-in closet.
    GreatRoom.xef - A large open space great room with living room, dining table, and kitchen.
    LivingRoom.xef - A living room with a fireplace, sofa, armchairs, and a coffee table with a vase.
    You can also record your own rooms to use in the emulator using the Simulation page of the Windows Device Portal on your HoloLens.

    On the emulator, you will only see holograms that you render and you will not see the simulated room behind the holograms. This is in contrast to the real HoloLens where you see both blended together. If you want to see the simulated room in the HoloLens emulator, you will need to update your app to render the spatial mapping mesh in the scene.


    Also, here is another link that can help you automate your testing:

    https://developer.microsoft.com/en-us/windows/holographic/using_the_hololens_emulator

    Hope that helps for your case.

  • hi Jason, thanks for your answer.
    Unfortunately I need this behavior in the final app, not just the simulator.
    The idea is that this app will only be used in a specific interior location, once I have pre-scanned this space I would load this mesh into Unity and place all my holograms. When the user launches the app it will check to see if the space that the user is in matches that of the pre mapped space. If this is the case it will load the holograms and/or start a process within the app. The existing "Holograms" app has a similar behavior and I'm trying to find out how to replicate this.

    Thanks again for your help.

  • edited June 2016

    @Plus2019,
    As Angela mentions, spatial anchors (world anchors, in Unity) are likely your best bet here. Since you mention pre-scanning the space, you can place your holograms in relation to one or more anchors and save their locations. The next time your application starts, the holograms will be where you left them.

    There are a few key benefits to this approach:
    1. If you need to move to a new space, you can rescan/reposition your holograms without needing to modify your application.
    2. If the holograms need to be moved within the space, you will not need to rebuild your application.
    3. If you desire, in the future, you can scan your space with an additional HoloLens (or several) and share the locations of the holograms. Then multiple users can see and interact with the same holograms together.

    See the Holograms 240 materials for an excellent example of using anchors to position holograms and share them with multiple users. This is the content we taught at //build 2016.

    Thanks!
    David

  • This is an old post, but do worldAnchors reset when the version of my application is updated?

  • Is there any way to convert a FBX 3D scan of a room into a Hololens readable space so the device can recognize my 3D scan (done with another device than an Hololens) as a pre-scanned space by the Hololens ?
    So I can place Holograms in Unity considering my FBX scan and when the app is run on the device, it automatically set those Hologram in the correct position in my real world.

  • edited September 2017

    @irsath

    can you achieve that ? Please help I have same scenario as like your
    Tanks in advanced...

    Thanks
    Ankit Sangani

  • @Plus2019 I know it has been 3 years now (bloody internet remembers everything :) )
    Do you mind sharing what solution you came up with in the end?

Sign In or Register to comment.