Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Prevent Camera Flip on [-90,90] rotation

$
0
0
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 ?

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>