topical media & game development
mobile-query-three-plugins-deviceorientation-examples-index.htm / htm
<!doctype html><title>tQuery Example</title>
<script src="../../../build/tquery-bundle-require.js"></script>
<body><script>
require(['tquery.deviceorientation'], function(){
var world = tQuery.createWorld().boilerplate().start();
var object = tQuery.createTorusKnot().addTo(world);
tQuery.createAxis().addTo(object);
world.removeCameraControls();
world.loop().hook(function(){
var orientation = tQuery.deviceOrientation();
// TODO put that directly on the THREEx
// with useragent sniffing for mac detection
// for macbook
//object.rotation( -orientation.angleY(), orientation.angleX(), orientation.angleZ() );
//object.rotation( -orientation.angleY(), 0, orientation.angleZ() );
// for ipad
object.rotation( -orientation.angleZ(), orientation.angleY(), -orientation.angleX() );
// no idea why it is different, nor what is the theorical value
})
});
</script></body>
(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.