The device orientation API periodically fires an event which contains the device's current orientation in space as expressed in degrees.
For this feature, m.grl should consume this event and cache the device orientation somewhere. Then, a driver function should exist that spits out the quaternion representation of this information, and possibly doing some other correction so as to put it in the correct coordinate space.
The ultimate idea here is that you can assign this to a camera's quaternion property and then have the viewport sync to the phone's physical orientation.
An example from the wild as to how this works can be found here: code, demo.
The device orientation API periodically fires an event which contains the device's current orientation in space as expressed in degrees.
For this feature, m.grl should consume this event and cache the device orientation somewhere. Then, a driver function should exist that spits out the quaternion representation of this information, and possibly doing some other correction so as to put it in the correct coordinate space.
The ultimate idea here is that you can assign this to a camera's quaternion property and then have the viewport sync to the phone's physical orientation.
An example from the wild as to how this works can be found here: code, demo.