How to use onSensorChanged sensor data in combination with OpenGL

后端 未结 6 1664
天涯浪人
天涯浪人 2020-12-07 10:05

( edit: I added the best working approach in my augmented reality framework and now also take the gyroscope into account which makes it much more stable again: Droid

6条回答
  •  星月不相逢
    2020-12-07 10:37

    After analyze your code above, in method 5 you are assigning the orientation data as follows,

    resultingAngles[1] = orientationData[0]; // orientation z axis to y axis
    resultingAngles[2] = orientationData[1]; // orientation x axis to z axis 
    resultingAngles[0] = orientationData[2]; // orientation y axis to x axis
    

    You have done rotation in y z x manner. Try to change the orientation..

    I think it might be the problem there.. Please check and let me know..

    Please refer the documentation for the event values, http://developer.android.com/guide/topics/sensors/sensors_position.html

    Thanks for your tough work..

提交回复
热议问题