I am trying to replicate how Google Skymap makes use of sensor inputs. I currently use getOrientation and the accelerometer values to determine up and rotation. This works fine whilst the phone is held perpindicular to the horizon, but starts to fail when pointing the phone towards the ground. for example when laid flat on a table, the readings used (accel_x) when spinning the phone does not affect this input, but when held perpindicular the values are useful and I am able to rotate the display based on the values.
(I currently display a basic horizon quad)
I am thinking that I need to make use of more than one value here but am quite at a loss of how to do it.
Any pointers?
Also, is there a 2.1 alternative to Display.getRotation?
Thanks in advance
开发者_如何学运维Note: I am only interested in the roll (in the aviation sense) of the phone, regardless of the pitch in which it is held.
精彩评论