获取 x 轴上的 Android 旋转角度 [英] Get Android rotation angle in x-axis

查看:41
本文介绍了获取 x 轴上的 Android 旋转角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试验一些 Android 功能.现在,我正在尝试获取设备的旋转角度,因此当我在画布上显示笑脸位图时,它总是看起来直".

I'm experimenting with some Android functions. Right now, I'm trying to get the rotation angle of the device, so when I show a happy face bitmap on a canvas, it always looks "straight".

我所需要的只是获得 x 轴旋转角度(我猜),但我找不到如何实现它.希望您能够帮助我.谢谢.

All I would need for this, is to get the x-axis rotation angle (I guess) but I can't find how to achieve it. Hope you can help me. Thank you.

推荐答案

您可以使用方位角、俯仰和滚转.不确定哪一个与您的x 轴"有关,但我认为它是方位角.

There is azimuth, pitch and roll available to you. Not sure which one relates to your "x-axis" but I think its azimuth.

是时候提供有用的链接了:

Time for helpful links:

  1. http://www.workingfromhere.com/blog/2009/03/30/orientation-sensor-tips-in-android/
  2. http://marakana.com/forums/android/examples/43.html
  3. http://marakana.com/static/tutorials/SensorDemo.zip

这篇关于获取 x 轴上的 Android 旋转角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆