开发者

How to use the sensor values in the same way as google skymap?

开发者 https://www.devze.com 2023-02-26 14:56 出处:网络
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 hel

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消