我想通过陀螺仪传感器的能力得到我想“看”的X、Y、Z位置的准确位置
我可以从陀螺仪传感器获得 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);
结果示例如下: