Firefox 3.6 and orientation in space

    Firefox developers have announced a new feature for Firefox 3.6 - support for spatial orientation in devices equipped with appropriate sensors.

    You can make the whole page rotate, or implement support for individual objects, so that they rotate independently of each other. For example, in this way you can implement control in browser-based web games ( an example of such a game).

    As shown in the video ( ogv , mp4 ), coordinates are recognized in three dimensions. When tilting the device forward / backward, the image in the browser will zoom in / out.



    Orientation support was originally developed for a mobile browser, but they decided to include it in regular Firefox, because some modern laptops are also equipped with such sensors.

    The feature is implemented through the API, and for its support it is enough to add such code.

    window.addEventListener("MozOrientation", function(e) {
                            /* 3 values: e.x, e.y, e.z */
                            }, true); 

    Here is additional information and documentation on the topic.

    Also popular now: