3 ms·
So, this is something that is not explained well with Device Orientation API. It's meant for holding your phone flat in your palm, parallel to the ground. In th
by moron4hire 12y ago
So, this is something that is not explained well with Device Orientation API. It's meant for holding your phone flat in your palm, parallel to the ground. In that orientation, the heading is reported relative to the top edge of the device. It can work in a landscape orientation, but at that point that top edge of the device is now pointing 90 degrees in the wrong dejection from what you probably intend, i.e. the back plate of the device. And in a portrait orientation, it completely gimbal locks.
For that very reason, I wrote this: https://github.com/capnmidnight/Psychologist.js/blob/master/html5/js/input/MotionInput.js https://github.com/capnmidnight/Psychologist.js/blob/master/...