什么';android.opengl.Matrix.rotateM的结果有什么问题?
我的代码:什么';android.opengl.Matrix.rotateM的结果有什么问题?,android,opengl-es,Android,Opengl Es,我的代码: float[] rotatePlus90Mtx = identityMatrix.clone(); Matrix.setRotateM(rotatePlus90Mtx, 0, 90, 0, 0, 1); Log.e(TAG, "RotatePlus90 Matrix: "); dumpMatrix(rotatePlus90Mtx); 结果是: -4.371139E-8 1.0 0.0.0
float[] rotatePlus90Mtx = identityMatrix.clone();
Matrix.setRotateM(rotatePlus90Mtx, 0, 90, 0, 0, 1);
Log.e(TAG, "RotatePlus90 Matrix: ");
dumpMatrix(rotatePlus90Mtx);
结果是:
-4.371139E-8 1.0 0.0.0
-1.0-4.371139E-8 0.0 0.0
0.0.0 1.0 0.0
0.0 0.0 0.0 1.0
为什么会有-4.371139E-8?应该正确地为0吗?它几乎是零;浮点数不精确 值得一读:
- “每一位计算机科学家都应该了解浮点运算 算术“
- “每一位计算机科学家都应该了解浮点运算 算术“
- 它几乎是零;浮点数不精确
值得一读: