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.

Any API to set the xyz location of a UWP 2D app in real space?

Id like to launch a UWP 2D app in a real space coordinate. Is there an API to do this? If not now is it planned to come?

Answers

  • One of our projects could also use the ability to programmatically position (actually reposition) 2D app windows (and secondary child app windows) in the shell when our app is launched.

    • one for exposing such an api

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • ContextVRContextVR ✭✭✭

    The Holograms app has one view with a list of 3D objects, and multiple secondary views that are placed separately, each showing a 3D hologram. The HoloLens App Model says that placement = launch, and that exclusive 3D apps take over the world. However, hologram objects don't seem to be running as separate processes on HoloLens, which suggests that the Holograms app is not actually a Unity app, but a multi-view XAML app that renders 3D objects in separate views, and that separate views in a multi-view app can also be placed in the world just like normal apps.

    Does anyone have enough experience with XAML apps on HoloLens to verify this?

  • @ContextVR the issue of mixed mode apps is yet another issue unto itself.

    Lets not complicate @holovr 's original question by going down that rabbit hole.

    Controlling the launch coordinates of 2D app windows programmatically is an important ask for enterprise and industrial applications, so I hope the point here does not get swept under the rug.

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • ContextVRContextVR ✭✭✭

    @HoloSheep You're right in that the part about mixed-mode apps warrants a separate thread, but the multi-view part still applies here: when you shutdown the Holograms app and restart it again, all child views (holograms) retain their original position in the world, so there must be a way to do this programmatically.

  • JasonJason ✭✭
    edited June 2016

    Have a look at the Holograms 211 tutorial as it uses the GestureManager and GestureAction scripts.

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

    I see from the GestureAction script that positional change is calculated:

    void PerformManipulationStart(Vector3 position)
    {
        manipulationPreviousPosition = position;
    }
    
    void PerformManipulationUpdate(Vector3 position)
    {
        if (GestureManager.Instance.IsManipulating)
        {
            /* TODO: DEVELOPER CODING EXERCISE 4.a */
    
            Vector3 moveVector = Vector3.zero;
    
            // 4.a: Calculate the moveVector as position - manipulationPreviousPosition.
            moveVector = position - manipulationPreviousPosition;
    
            // 4.a: Update the manipulationPreviousPosition with the current position.
            manipulationPreviousPosition = position;
    
            // 4.a: Increment this transform's position by the moveVector.
            transform.position += moveVector;
        }
    }
    

    @holovr Is my assumption correct that the app should save the 2D app window coordinates? Would the app windows map to pre-mapped environment data already loaded into your app? Does the game Fragments already do that? It seems to me that the menus (i.e. Tools/ Objectives) in the game are 2D app windows but that is also my assumption.

    Hope this offers some value to the conversation to get the brain waves flowing as I also question how to do this.

  • holovrholovr ✭✭

    @Jason thanks for pointing that out but the original question is not for Unity but for native C# UWP apps.

    The question is how to launch windows in an app and position them at xyz in real world space.

    As others have pointed out this is done with the holograms app. It does not appear to be a unity app since it lives within the window space of other apps

  • lillemorblillemorb
    edited October 2017

    I too am very interested in knowing if there is a way to programmatically control the position of 2D UWP app windows. Anyone? It would be really nice to find some information, preferably from some official Microsoft source, that definitely tells us if it can or can not be done...

  • Hi,
    Do you have any other news on this topic ? If it's possible or not ?

Sign In or Register to comment.