2
我想要得到的X,Y,Z位置的準確位置,我想「看在」通過陀螺傳感器的能力Android的陀螺 - OpenGL的注視位置
我能得到到陀螺儀傳感器的9個數值,但我無法弄清楚這個陀螺儀傳感器的確切位置的公式。
我希望公式或一個例子,以獲得正確的答案
這裏是我想要的結果轉出結果的
double standX = 0.0f, standY = 0.0f, standZ = 0.0f;
double lookX = 0.0f, lookY = 0.0f, lookZ = 1.0f;
double headupX = 0.0f, headupY = 1.0f, headupZ = 0.0f;
float[] deltaRotationMatrix = new float[9];
SensorManager.getRotationMatrixFromVector(deltaRotationMatrix, deltaRotationVector);
// code here
// in my onDraw
// I'm trying to make the lookAt position proper
Matrix.setLookAtM(mViewMatrix, 0,
eyeX, eyeY, eyeZ, lookX, lookY, lookZ, headupX , headupY, headupZ);
例子的代碼如下位置: