How to use onSensorChanged sensor data in combination with OpenGL

后端 未结 6 1667
天涯浪人
天涯浪人 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:14

    It would be easier to test and debug Method 5 using GLU's lookAt function: http://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml

    Also, as villoren suggested it's good to filter your sensor data, but it wouldn't really cause bugs if you move de device slowly. If you want to try, a simple one would be as follows:

    newValue = oldValue * 0.9 + sensorValue * 0.1;
    oldValue = newValue;
    

提交回复
热议问题