This is my vertex shader code:
attribute vec4 position;
attribute vec4 inputTextureCoordinate;
varying vec2 textureCoordinate;
uniform mat4 modelViewProjMatrix;
void main()
{
gl_Position = modelViewProjMatrix * position;
textureCoordinate = inputTextureCoordinate.xy;
}
And I update uniform in this code:
glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEWMATRIX], 1, 0, [scaleMatrix getMatrix]);
But when I execute this string last update result(scale) resets:
glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEWMATRIX], 1, 0, [rotationMatrix getMatrix]);
How I can use more than one matrix?
You have to multiply the matrices together. Do this in the CPU and pass the result as the uniform.