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.
Start position of application
Hi, I just started creating Apps for Hololens using Unity.
After I start my App the objects will be created relative from the head position. Is it possible to get the position where the application has been placed and show my hologram there? (if I place the application on a table I want my Holograms to be right on that table, not floating in front of my head)
Best Answer
-
OptionsAlexD ✭✭✭
That's an interesting thought, however that is not how the system works at this point.
The tile of the application lives in a different holographic space than your objects in your application.
Your application space gets initialized when you start your application, so as far as it knows, the origin of the world is the position of your head when the app was initialized. That might be different than the world space of the shell where you pin your tiles.There is one way to achieve a mapping between them and that is though
world anchors
but this is not done automatically.
Essentially what you want to do is implement a functionality in your app so that the first time you run your app, you can place your objects and establish a world anchor for them (potentially in the same place where the tile was). Next time you run the app, you can load the anchor and position the objects in that exact spot, regardless of your position in the room.You can read more about coordinate systems and world anchors in the documentation
5
Answers
That's an interesting thought, however that is not how the system works at this point.
The tile of the application lives in a different holographic space than your objects in your application.
Your application space gets initialized when you start your application, so as far as it knows, the origin of the world is the position of your head when the app was initialized. That might be different than the world space of the shell where you pin your tiles.
There is one way to achieve a mapping between them and that is though
world anchors
but this is not done automatically.Essentially what you want to do is implement a functionality in your app so that the first time you run your app, you can place your objects and establish a world anchor for them (potentially in the same place where the tile was). Next time you run the app, you can load the anchor and position the objects in that exact spot, regardless of your position in the room.
You can read more about coordinate systems and world anchors in the documentation
Toronto-HoloLens | Blog | @alexdrenea
My new approach is to have a preview of the hologram at a fixed position e.g. 1 meter in front of the User so he can place it (I am currently looking into the Tagalong script). After the user confirms the position with the tab-gesture remove the preview and set the real Hologram there. (as far as real is the right term, because it is still an object in a virtual environment ;-) )
Instead of the Tagalong/SimpleTagalong of the HoloToolkit I created my own simple FixedTagalong which just moves the Object with the camera. I think I will make it move smoother but it works for now. I was overthinking it at first, it is really basic stuff in Unity, so here the code if anyone is interested (I also like to hear comments if this is a good idea or if I should do this differently)
https://gist.github.com/brean/5210d01240116573d61556173837745e