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 set maximum distance between Camera and Hologram

Hi in my hololens app I have a hologram (spatial mapping on). When I run the app and apply drag and drop functionality , it simply place the hologram at next available place (3D wired mesh). Is there any way to limit the maximum distance between camera and holograms. I dont like my hologram to place too far from the camera after dragging. Thanks

Answers

  • Options

    If you are using the HoloToolkit scripts for this, you'll want to hack them a bit. If you look at the code you are using, you'll notice that your hologram is getting placed at the intersection of your raycast and the mesh. You can change this to set a max distance when the mesh is further than floatMaxDist meters away. If you are literally using the TapToPlace script, then you can replace:

    gameObject.transform.position = hitinfo.point;

    with

    gameObject.transform.position = headPosition + gazeDirection * floatMaxDist;

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • Options

    @james_ashley Thanks I will try to apply the changes according to your suggestions.

Sign In or Register to comment.