Android.Hardware.SensorManager.RemapCoordinateSystem Method

Syntax

[Android.Runtime.Register("remapCoordinateSystem", "([FII[F)Z", "")]
public static bool RemapCoordinateSystem (float[] inR, [Android.Runtime.GeneratedEnum] Axis X, [Android.Runtime.GeneratedEnum] Axis Y, float[] outR)

See Also

SensorManager.GetRotationMatrix(Single[], System.Single[], System.Single[], System.Single[])

Parameters

inR
the rotation matrix to be transformed. Usually it is the matrix returned by SensorManager.GetRotationMatrix(Single[], System.Single[], System.Single[], System.Single[]).
X
defines on which world axis and direction the X axis of the device is mapped.
Y
defines on which world axis and direction the Y axis of the device is mapped.
outR
the transformed rotation matrix. inR and outR should not be the same array.

Returns

Documentation for this section has not yet been entered.

Remarks

Rotates the supplied rotation matrix so it is expressed in a different coordinate system. This is typically used when an application needs to compute the three orientation angles of the device (see SensorManager.GetOrientation(Single[], System.Single[])) in a different coordinate system.

When the rotation matrix is used for drawing (for instance with OpenGL ES), it usually doesn't need to be transformed by this function, unless the screen is physically rotated, in which case you can use Android.Views.Display.Rotation to retrieve the current rotation of the screen. Note that because the user is generally free to rotate their screen, you often should consider the rotation in deciding the parameters to use here.

Examples:

  • Using the camera (Y axis along the camera's axis) for an augmented reality application where the rotation angles are needed:
  • Using the device as a mechanical compass when rotation is Android.Views.Surface.ROTATION_90:

      Since the resulting coordinate system is orthonormal, only two axes need to be specified.

      [Android Documentation]

      Requirements

      Namespace: Android.Hardware
      Assembly: Mono.Android (in Mono.Android.dll)
      Assembly Versions: 0.0.0.0
      Since: Added in API level 3