Im trying to rotate object in OpenGL ES around its center. When i use Matrix.translateM() on the same axis what Matrix.setRotatem() it changing my object center to 0 on this axis. When i trying operation below:
Matrix.translateM(rotationMatrix, OFFSET, 0, 1, 0);
Matrix.setRotateM(rotationMatrix, OFFSET, 90, 0, 1, 0);
Matrix.translateM(rotationMatrix, OFFSET, 0, -1, 0);
But when i do something like this:
Matrix.translateM(rotationMatrix, OFFSET, 0, 0, 0);
Matrix.setRotateM(rotationMatrix, OFFSET, 90, 0, 1, 0);
Matrix.translateM(rotationMatrix, OFFSET, 0, 0, 0);
The second picture it's a correct look. So, my question is: Why translating on y axis, creates this mess.