I have been trying to understand these 2 lines of code
SensorManager.getRotationMatrix(RTmp, I, grav, mag);
SensorManager.remapCoordinateSystem(RTmp, SensorManager.AXIS_X,SensorManager.AXIS_MINUS_Z, Rot);
I read the documentation of remapCoordinateSystem()
, however I am lost.
Can anyone explain to me what exactly getRotationMatrix
and remapCoordinateSystem
do? Specially the SensorManager.AXIS_X
, SensorManager.AXIS_MINUS_Z
?
Asking such a question totally out of context is generally hard to answer. Also you should get familiar with formatting (e.g: 4 spaces indicates code):
However:
I would say that you are on the right track using the documentation. As you see getRotationMatrix pulls the current rotation matrix needed to transform the "world coordinate system" to the current device coordinate system. Additionally remapcoordinateSystem transforms the given coordinate System accordingly to the given rotation Matrix. But as stated above - out of context it is hard to tell you WHY somebody is doing this.