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.

How to use HoloLens compass

martymarty
edited December 2016 in Questions And Answers

Greetings Windows Holographic community,

I'm making an application and I want to include a compass, so you know where you are looking at (north, south, east, west etc), first to try, by just using the degrees and debug it, then linking the data to a compass image, which rotates. However, I can't seem to make the compass in the HoloLens work.

I'm trying to use this code, which works inside normal Unity apps with the HoloLens, but I'm getting respond (0.0, 0.0, 0.0, 1.0)

Input.location.Start();
Debug.Log(Quaternion.Euler(0, -Input.compass.trueHeading, 0));

So, this function cannot be used with the HoloLens? Does anybody know an other way to use the compass on the HoloLens?
Thanks in advance.

Kind regards,

Marty

Answers

  • Hi @marty,

    Your device's magnetometer is accessible. Most of the HoloLens sensors, other than the localized rgb camera, are not accessible. The Unity API Input.compass is for mobile devices and not the hololens.

    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

Sign In or Register to comment.