Here is a project that shows how to integrate the management of the accelerometer in your HTML5 games.
Just add the source of your project accelerometer.js the script, and set the installation event in early stage.
The script will automatically install some global variables that can be used in the events of your scene:
Acceleration on three axes X, Y and Z
- accel_gravity_x: Force on the axis perpendicular to the North (roll)
- accel_gravity_y Strength on the axis perpendicular to the East (pitch)
- accel_gravity_z: Force around these two axes (yaw)
For the gyrometer:
- accel_rotation_alpha: Acceleration of the rotation around the X axis
- accel_rotation_beta: Acceleration of the rotation around the axis Y
- accel_rotation_gamma: Acceleration of the rotation around the Z axis
For more information on these data:
sites.google.com/site/wikismart … tomtresgps