HTML5 includes some useful features to detect the orientation of your smartphone or tablet in the real world. Here are the specifications to describe the usage (warning: brings back some headaches of 3D vector maths and rotation concepts if one wants to dig deeper).
I tried to incorporate the device orientation concept into the floating creatures demo, and introduced a gravity vector that points to the physical ground if your device supports the feature. The screen orientation lock should be turned on for best effects. Try the demo here on a smartphone or tablet.