Fooled with device rotations.

This demo ignores the compass heading, partly because it's often wildly inaccurate on iPhones but mainly because it's not going to be orthogonal with the other rotation axes. Gimbal locking is still a problem, but I think it works properly within the first 90 degrees, at least if you start with the device flat on a table.

A better solution for full-frame arbitrary rotations is to convert alpha, beta, gamma into quaternion form. That's a huge huge pain but it … may? Solve gimbal locking?

Also, the accelerometer delivers forces, not velocities. These were mislabed as Vx,y,z on the demo page. You can time-integrate them if you do want velocity, but that's probably not going to be robust.
Merge pull request #1 from kconner/device-relative-rotations

Fooled with device rotations.