Greetings all -
I need to use my mobile device to pan across a 360 degree landscrape with some vertical movement. I know about “deviceorientation” but when I rotate my phone to be straight up, my ALPHA values start jumping from 0 to 70 to 340. Something is freaking out.
I know THREE has really good motion support for a 3D environment so that such wigging out doesn’t occur, but the fact is, I can’t build this project of mine in a 3D space: it’s all 2D DOM elements and 2d context canvas.
How can I translate THREE’s Euler and Quaternian smooth camera movements to a simple 2D plane?
var _controls = new THREE.DeviceOrientationControls(camera, true); _controls.alpha; // returns a Radian value
In the above instance, I can convert my Euler radian value back to degrees, but then I might as well be using stock window.ondeviceorientation listeners. I don’t know how to compensate for phone flippery in a 2D space.