topical media & game development

talk show tell print

mobile-query-three-vendor-threex-examples-THREEx.DeviceOrientationState.htm / htm



  <html>
  <body>
          angleX: <span id="angleX"></span><br/>
          angleY: <span id="angleY"></span><br/>
          angleZ: <span id="angleZ"></span><br/>
          <script src="../THREEx.DeviceOrientationState.js"></script>
          <script>
                  var deviceOrientation        = new THREEx.DeviceOrientationState();
                  var elementX        = document.getElementById('angleX');
                  var elementY        = document.getElementById('angleY');
                  var elementZ        = document.getElementById('angleZ');
                  setInterval(function(){
                          elementX.innerHTML        = deviceOrientation.angleX();
                          elementY.innerHTML        = deviceOrientation.angleY();
                          elementZ.innerHTML        = deviceOrientation.angleZ();
                  }, 100);
          </script>
  </body>
  </html>


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.