So i'm using the html5 deviceorientation API to get device euler rotation values alpha, beta, gamma, and I want to use the gamma value to rotate a webgl scene on my phone. The scene rotates fine when I move the value within that range. However, once I go beyond -90 for example (happens when I point my phone upward), the next gamma value I get is 89. This has the effect on making the scene suddenly flipping and looking down instead of 1 more degree upwards.
Question is. Is there a way to normalize the value such that the jump from -90 to 89 is treated as looking 1 more degree upwards ?
↧