There are two methods to rotate matrices in android.opengl.Matrix class, they are:
-
static void rotateM (float[] m, int mOffset, float a, float x, float y, float z)
Rotates matrix m in place by angle a (in degrees) around the axis (x, y, z) -
static void setRotateM(float[] rm, int rmOffset, float a, float x, float y, float z)
Rotates matrix m by angle a (in degrees) around the axis (x, y, z)
Here is the original ducumentation
These methods act a bit different, but I don’t understand the exact difference. Coul you explain this to me?
Let’s say matrix R is rotation matrix around (x,y,z) axis by angle a, then rotateM method modifies existing matrix m like this:
m = R * m, but setRotateM overwrites it:m = R.