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.
Options

How to sync placement of Anchor

sebseb
edited October 2017 in Questions And Answers

So I have setup a Unity project where I want to sync a Anchor between the devices. I do this using a custom TCP transfer and I can successfully import the batch on the receiving end. However I don't get how to "draw" the hologram at the same place as the sender?

Should I just attach it to a random GameObject or does this GameObject need to be structured in some special way? I mean there will be no single point of reference here?

I read this: https://mtaulty.com/2017/03/14/hitchhiking-the-holotoolkit-unity-leg-11-more-steps-with-sharing-holographic-experiences/ and it seems to suggest something like that but then again, that is working with the Server which I am not.

So how do I get the hologram to appear at the same relative place on both Hololenses?

Also: sometimes the import succeeds (as per delegate SerializationCompletionReason) but contains 0 anchors. Is this common?

Tagged:

Best Answer

Answers

  • Options

    If you are doing Peer-to-Peer and not Server based, I'd check out the Holotoolkit on GitHub. Specifically look at the SharingwithUnet example under Holotoolkit Examples folder. The heavy lifting script that you and @mtaulty are describing is the UNetAnchorManager.cs

    AR Developer

  • Options

    I give an overview of sharing in a recent blog post:
    http://talesfromtherift.com/hololens-contest-week-9/

  • Options

    @peterept I wish I would have found this like 2 weeks ago haha It would have definitely saved me a bunch of time. Great information on there

    AR Developer

  • Options

    @mtaulty said:
    If you have managed to attach an anchor (which is located) to a GameObject on one device and then you have exported it in a batch, transferred it over the network and imported it on the receiving side then I think the next stage is to pull the anchor out of the batch and to call LockObject() on it, passing the GameObject that you want to position at the anchor's location.

    What I usually do is to associate anchors with a parent object and I put my "holograms" within that parent but you don't have to go that route.

    So...to get the hologram to appear at the anchored position, you first have to create that GameObject on the receiving device (which means possibly knowing what to create if there's more than one possibility) and then call LockObject() to anchor it.

    I hope that helps.

    Thanks. This is how I guessed it would work.

    As I said, I'm doing a client-server-client thing that is not using the Sharing Service. I simply transfer the batch as raw data and then import it.

    A BIG however... however is that something weird is going on when importing the data: Unity3D methods reports that the import "Succeeded" but the batch contains 0 anchors. I've reached out to Unity and you can read my thread here:
    https://forum.unity.com/threads/deserialization-succeeds-but-0-anchors-in-batch.498549/

    That has to be a bug on Unity side right? How can it import but contain 0 anchors. Has anyone seen this before?

Sign In or Register to comment.