I could get the transform matrix(4x4) from surface by getTransformMatrix()
, but I don't know how to set scale x,y or set pivot x,y of it. I don't know the matrix structure in this case.
Help me. Here is the code:
private SurfaceTexture mSurface;
private float[] mTransformMatrix = new float[16];
private int mTransformMatrixHandle;
public void onSurfaceCreated(GL10 glUnused, EGLConfig config) {
...
mTransformMatrixHandle = GLES20.glGetUniformLocation(mProgram, "textureTransform");
}
public void onDrawFrame(GL10 glUnused) {
...
mSurface.getTransformMatrix(mTransformMatrix);
//how to set pivot/scale mTransformMatrix
...
GLES20.glUniformMatrix4fv(mTransformMatrixHandle, 1, false, mTransformMatrix, 0);
...
}