I’m rotating with model in Android’s OpenGL.
Why those two examples below don’t produce same results? I thought, there is no difference, when I rotate about axis x and then y or y and then x.
gl.glRotatef(_angleY, 0f, 1f, 0f); //ROLL
gl.glRotatef(_angleX, 1f, 0f, 0f); //ELEVATION
gl.glRotatef(_angleZ, 0f, 0f, 1f); //AZIMUTH
gl.glRotatef(_angleX, 1f, 0f, 0f); //ELEVATION
gl.glRotatef(_angleY, 0f, 1f, 0f); //ROLL
gl.glRotatef(_angleZ, 0f, 0f, 1f); //AZIMUTH
Unless those rotations are all applied simultaneously, I would think order definitely would matter.
If I had a cube and I rotated it around the x axis and moved the front face to the top, after rotating around the y axis, the original front face would still be on the top.
If instead I first rotated around the y axis then the original front face would be moved aside so when I then rotated around the x axis the original front face would NOT be rotated to the top.
I believe that order of rotation does matter.