Chrome 40.0.2214.111 on Yosemite. Not really cross-browser when its not working in newest Chrome ...
Edit: tried it on iPhone, its working but orientation is reversed. For example I turn to North, turn left 90 deg and instead of showing West, its showing East.
"Move in the way you look for about 50 meters."
If you walk a straight line and the Laptop knows where it is at any given time it can infer the heading.
Here is a link to the 3d web compass I built and submitted to Hacker News 3 years ago [1] (direct link to a demo @ [2]).
I also released a JavaScript library based on that research that may help others use web device orientation without needing to understand all the math involved [3]. That in turn is based on a primer I made for web developers @ [4].
I hope this helps others who want to use device orientation on the web to build web-based compasses, Virtual Reality and Augmented Reality experiences!
[1] https://news.ycombinator.com/item?id=4115768.
[2] https://richtr.github.io/Marine-Compass/
[3] https://github.com/richtr/Full-Tilt
[4] https://dev.opera.com/articles/w3c-device-orientation-usage/
Plus, the demo is counter intuitive - the needle should point north, not where I'm pointing my phone. That's how a magnetic compass works. I'm not Jack Sparrow.
Thank you. That's the first time in a while I've laughed out loud. It's been a dreary week.
On the other hand, I've got to give props to what is clearly a project someone worked hard on. It's got a very attractive design, despite it's technical difficulties (that may be surmountable!).
But also, a lot of things don't work on my phone (not even Youtube I can watch on the browser, I have to use an app for that; a non-official one btw).
[1] https://developer.mozilla.org/en-US/docs/Web/API/Screen.orie...
For that very reason, I wrote this: https://github.com/capnmidnight/Psychologist.js/blob/master/...
- Chrome 39 - Firefox Mobile (with the moz prefix).
Apparently the API is also supported by the following Desktop browser versions...but I'm not sure this app takes advantage of it:
- Chrome 38 - Firefox (Gecko) - IE 11 - Opera 25
[1] https://developer.mozilla.org/en-US/docs/Web/API/Screen.orie...
An interesting additional feature might be some means to indicate magnetic declination. Actually, if you also grab GPS location, you should be able to calculate it and correct magnetic north back to true north.
One note, usually it's the needle that moves with the orientation, not the dial.
With regard to the dial rotating rather than the needle, it's an interesting point (no pun intended :) I think each has its own merit for certain applications - probably worth adding an option to choose.