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.

Placing holograms at specific position

Hello community,

I am currently working on a Unity project for HoloLens. Therefore I need to place holograms in a scanned room.

In an older project I realized this issue with a VuMark from Vuforia (see video).
This time I want to place each hologram at a specific position in the room without looking at a VuMark.

I would be very delighted if someone could help me.

video link: https://vimeo.com/groups/485303/videos/214519563

Answers

  • Hey, @SOfian2017

    Just place them there with a gesture or by whatever means convenient, add a WorldAnchor to each and and save your anchor collection either in a per-app WorldAnchorStore or in an app-independent/device-independent WorldAnchorTransferBatch.

    Cheers

    Building the future of holographic navigation. We're hiring.

  • stepan_stulovstepan_stulov ✭✭✭
    edited May 2018

    Hey, @SOfian2017

    Not sure which of my suggestions made you vote it down. Would you please mind elaborating? I appreciate your opinion so that in the future I reply more satisfyingly.

    Thanks!

    Building the future of holographic navigation. We're hiring.

  • Hey @stepan_stulov ,

    I voted your comment down because placing the holograms by tapping gesture wasn't my intention.
    I wanted to set the position in my code so that it is unchangeable for users of my app because the stationary place is vital for the program's function.

    Nevertheless, thanks for your help!

  • I have the same exact same need as @SOfian2017 but I can't seem to find a way to do it. I have read multiple threads asking the same like this one or this one but they recommend manually placing the holograms first in a sort of config-run and then saving a world anchor with them.

    My desired workflow is:

    • Room is pre-scanned with spatialUnderstanding and the .obj is downloaded from the device portal.
    • Room model is loaded into Unity and several holograms are placed in the editor based on its position relative to the room.
    • When the app is run, the Hololens recognizes the starting point that might be different on every run and compares it with the room model it has so it can correctly place and align the holograms where they should be (Is this even possible?).

    Notice that from the first run of the app the holograms should be placed correctly and that is why a config-run is not a good solution for me.

    Right now I'm having problems with the second point; I don't know how to add holograms to the room model in the editor based on their real position relative to the room. The third point seems even more difficult from my inexperience with Hololens.

    @stepan_stulov, do you have any idea if this is doable?

  • @stepan_stulov Do you have any suggestion for this one? Thank you very much.

  • stepan_stulovstepan_stulov ✭✭✭
    edited June 2018

    Hey, @SOfian2017

    From your explanation, kindly provided:

    I voted your comment down because placing the holograms by tapping gesture wasn't my intention.
    I wanted to set the position in my code so that it is unchangeable for users of my app because the stationary place is vital for the program's function.

    And from my initial reply:

    Just place them there with a gesture or by whatever means convenient...

    I have carefully re-read your question and also re-watched the video. My initial suggestion was more generic than needed: use gesture, or don't. I apologize for this generalization. I simply focused on the whole solution rather than just the positioning part. May I still ask you to remove the down-vote, kindly? That'd mean a lot to me.

    As to using no gestures. I imagine what you actually want is not not using gestures, but not allowing the user to later edit the positions. This is easy to achieve by either having a restricted positioning mode inside your app in which you can initialize/edit the holograms' positions and then a normal scenario mode where positions are fixed. In this case you might want to use WorldAnchorStore. Alternatively instead of a separate mode inside of the same app you can actually have a second positioning app. It would then produce a WorldAnchorTransferBatch that you will then need to feed into your normal scenario app. Something along those lines.

    If you, however, imagine no user input at all, neither with positioning privileges nor with normal privileges, and Vuforia (or other markers) is not desired at all, then you'd want to understand how you'd recognize real world positions by the means of some kind of image recognition / spatial mapping analysis. Honestly, though, I don't recommend going this way. Restricted admin-only positioning mode is a million times easier.

    What you can of course also do is have your room's 3D model and position your holograms on PC. Then simply align the whole rig onto the room. But you still have at least one tap-to-place. This alignment could perhaps be done automatically, but we're back to fuzzy mesh comparison which is harder that tap-to-place.

    Hope this helps.

    PS: I suggest rewarding people with up-votes when their replies are helpful and simply ignoring them if not. Down-voting (unless outright poisonous behavior) is counter-productive and makes people reserved about providing further help not just to the voter but also to other members of the community.

    Building the future of holographic navigation. We're hiring.

  • stepan_stulovstepan_stulov ✭✭✭
    edited June 2018

    Hey, @si_butorovic

    When the app is run, the Hololens recognizes the starting point that might be different on every run and compares it with the room model it has so it can correctly place and align the holograms where they should be (Is this even possible?).

    Do you have any idea if this is doable?

    I haven't seen any such solution myself but I imagine it could be possible to recognize that the meshes are almost the same with some tolerance. I'm still not a fan of such solutions as it inevitably introduces unreliability depending on the algorithm implementation. Ultimately you still have to position the points somewhere, when going marker-less. It's almost a question of taste, do you prefer walking around and placing holograms or sitting at your desk and placing them. I prefer the former, some the latter. I believe in Daqri's WORKSENSE they made seamless integration between the room scan and the runtime, so that positioning of the anchors in their editor is recognized seamlessly at runtime. But that's not HoloLens. On HoloLens anchors are runtime-only.

    Cheers

    Building the future of holographic navigation. We're hiring.

  • Thanks for your answer @stepan_stulov.

    One more question though, with the tap to place world anchor approach, would the user need to start the app on the same spot in the room every time so the holograms are well placed?

  • Hey, @si_butorovic

    One more question though, with the tap to place world anchor approach, would the user need to start the app on the same spot in the room every time so the holograms are well placed?

    No, she wouldn't. The beauty of anchors is that, they're anchoring the object to the environment, not the user's position. You can start anywhere you want. There are a few tech "buts" to it such as you have to always keep your camera position to 0,0,0 in your Unity scene for both the positioning app and the scenario app otherwise a shift may be introduced. Anchors are also room specific and won't work if you start your app in a new room.

    Cheers

    Building the future of holographic navigation. We're hiring.

  • @stepan_stulov Thanks for the solution! I'm running into similar question-- I want to place Holograms at specific positions on the floor. Any suggestions? Thank you!

  • marliesmarlies
    edited September 2019

    I also had this idea of placing the Holograms in Unity, since I`m writing the program for a specific lab. But as Stepan said, it's much easier to place them in the environment with the Device.

    So I simply added an "admin" mode to my program. Before handing the Hololens to a customer (or whomever) you can place the objects without interfering with the usual workflow of the app. Before every use you can check if the Holograms are still on the right place and readjust if necessary - but if you don't change the room, they should stay where they belong.

    In my case, it's only a button called "Rearrange" in my menu, that activates the Manipulation Handlers of the Holograms (and the Anchors are saved after every manipulation, of course).

  • Hi all!

    I have a problem similar to the one si_butorovic described above:

    I want a hologram to spawn at a very specific spot as precise as even possible. I have used Vuforia's marker tracking before but I am willing to dump this due to the lack of precision since the loaded holograms have been "swimming" too much when I moved around the marker.
    So I had the idea of scanning the whole room, make it be recognized by the HoloLens and position the object at the exact spot, inspired by this tutorial:
    https://docs.microsoft.com/de-de/windows/mixed-reality/holograms-230.

    By now I have scanned the room and imported it into Unity but now I am kind of stuck since I do not know how to create this spawn point/world anchor. It has to be set via code/editor because of precision so creating a world anchor from a free placing by hand is no real option.
    I have thought about some kind of cross-interaction betweeen Vuforia and World anchors in terms of finding the marker with the bound hologram and then setting a world anchor of this marker-placed hologram to make it independent from the marker but this seems kind of complicated (if it is even possible like this...)
    Any suggestions for this?

Sign In or Register to comment.