android - Matrix.setRotateM 和 Matrix.rotateM 有区别吗

标签 android matrix opengl-es-2.0

在android.opengl.Matrix类中有两种旋转矩阵的方法,它们是:

  1. static void rotateM (float[] m, int mOffset, float a, float x, float y, float z)
    将矩阵 m 绕轴 (x, y, z) 旋转角度 a(以度为单位)

  2. 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/

相关文章:

c++ - 将 .mat 文件从 MATLAB 转换为 OpenCV 中的 cv::Mat 矩阵

python - 用 Python 中行中其他元素的总和替换矩阵的对角线元素

android - GLSurfaceView.RENDERMODE_CONTINUOUSLY 导致闪烁

android - 如何在android中实现请求超时?

android - 正则表达式在匹配后提取 5 个单词

c++ - 理解旋转 N x N 矩阵的逻辑

ios - 为什么 GLSL 的算术函数在 iPad 上与在模拟器上产生如此不同的结果?

Android : OpenGL 2. 0 第一人称相机

android - Android TTS 中是否支持 SSML?

android - 无法访问某些手机数据/数据中的本地文件