0

The idea is to create a HoloLens application that displays a hologram which can then be manipulated through the UWP application run on the desktop. The desktop application would contain various UI elements that manipulate the hologram(ie. a rotation button to turn it 45 degrees) and of course, see the same object as in the HoloLens. Naturally, I arrived at the 240 academy tutorial, but that seems a bit outdated compared to the current version of the Holotoolkit. It also doesn’t really fit my scenario, since I am not sharing between two HoloLens devices, but a desktop and a HoloLens. I figured that that shouldn’t really matter since you are still targeting for the UWP, but I wasn’t sure.

So what I tried so far was trying to edit the example scene “SharingSpawnTest” and target it for the PC to see what would happen, but I thought this wasn’t the way to do it since the project settings are set for Mixed Reality and not a regular UWP application for the desktop.

My question is basically if this is even possible and if so, how do I achieve this? Do I have to create two separate projects, one for the desktop and one specifically for the HoloLens and communicate that way?

Sou
  • 25
  • 7
  • Have you tried adding a NetworkManagerHUD component to the NetworkManager object? When I did this I could get the IP address of the HoloLens and connect to it that way. I never tried deploying it but, it worked through the editor. This is assuming that you are using SharingWithUnet of course. – Dtb49 Mar 28 '18 at 13:54
  • I haven't tried it that way. I will tried that tomorrow and give an update. Thanks! – Sou Mar 28 '18 at 17:19
  • @Dtb49 Thanks a lot for the suggestion. I got it working, but I do have 1 problem. I want the desktop application to be the server, but the HoloLens application can't connect to it. It does work vice versa, but I want the object that needs to be manipulated to be on the desktop application. Any suggestions? – Sou Mar 29 '18 at 13:18
  • It shouldn't matter which is the host or client, if you write your Commands and Rpc's correctly you should be able to manipulate it from either device. However, the desktop cannot become the host without you writing some custom code because WorldAnchorStore does not work on the desktop. If you were to get them working on there then it would be a possibility. – Dtb49 Mar 29 '18 at 13:26

1 Answers1

0

Add a NetworkManagerHUD component to your NetworkManager object. Once you add it, type in the HoloLens IP address and connect to it. Currently, this only works for HoloLens to be the host and the desktop to be the client.

Dtb49
  • 1,211
  • 2
  • 19
  • 48
  • Thank you! I read your previous comment as well. I initially thought that only the server that spawned the object was able to manipulate the object. I will try figuring manipulating the servers' object from the client tomorrow, but I at least got the communication to work. – Sou Mar 29 '18 at 18:50
  • Definitely take a look at [Commands](https://docs.unity3d.com/ScriptReference/Networking.CommandAttribute.html) and [ClientRpcs](https://docs.unity3d.com/ScriptReference/Networking.ClientRpcAttribute.html) – Dtb49 Mar 29 '18 at 18:53
  • I am have difficulty implementing this at the moment. The player prefab doesn't spawn on the client probably because of the issue with the worldanchorstore as you mentioned before. This causes to have a client without a player object that can send commands. I did read that you could authorize the client with "NetworkServer.SpawnWithClientAuthority" or "NetworkIdentity.AssignClientAuthority" to allow commands from non-player objects, but I don't really know where to implement this. – Sou Mar 30 '18 at 11:33
  • I created a follow-up question: https://stackoverflow.com/questions/49575706/uwp-and-hololens-unet-command if you are interested – Sou Mar 30 '18 at 13:53