[Android] センサー(Sensor)のAzimuth/Pitch/Roll

| トラックバック(0) |
以前のセンサー記事「[Android] Redesigned Sensor Manager APIs(Android1.5) | The type SensorListener is deprecated - adakoda」にも書いたSensorEventListener.onSensorChanged()に渡されるSensorEvent.values[0~2]の値は、順にAzimuth(方位角)/Pitch(傾斜)/Roll(回転)の値であり、ヘルプには、以下のように書かれています。

values[0]: Azimuth, rotation around the Z axis (0<=azimuth<360). 0 = North, 90 = East, 180 = South, 270 = West
values[1]: Pitch, rotation around X axis (-180<=pitch<=180), with positive values when the z-axis moves toward the y-axis.
values[2]: Roll, rotation around Y axis (-90<=roll<=90), with positive values when the z-axis moves toward the x-axis.

が、わかりにくいですし、説明もしづらい。。。
と思っていたら、わかりやすい説明を見つけました。

http://www.novoda.com/blog/wp-content/uploads/2009/05/sensoreventcheatsheet_v1.pdf
※実機で確認済です

トラックバック(0)

トラックバックURL: http://mt.adakoda.com/mt-tb.cgi/154

Android Advent Calendar 2011

2012年2月

      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29