在android.opengl.Matrix类中有两种旋转矩阵的方法,它们是:
static void rotateM (float[] m, int mOffset, float a, float x, float y, float z)
将矩阵 m 绕轴 (x, y, z) 旋转角度 a(以度为单位)static void setRotateM(float[] rm, int rmOffset, float a, float x, float y, float z)
将矩阵 m 绕轴 (x, y, z) 旋转角度 a(以度为单位)
Here is the original ducumentation
这些方法的作用有点不同,但我不明白确切的区别。你能给我解释一下吗?
最佳答案
假设矩阵 R 是绕 (x,y,z) 轴旋转角度 a 的旋转矩阵,则 rotateM 方法会像这样修改现有矩阵 m:m = R * m
,但 setRotateM 会覆盖它: m = R
。
关于android - Matrix.setRotateM 和 Matrix.rotateM 有区别吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11818417/