PDA

View Full Version : question about uniformMatrix4fv



pzinn
05-06-2010, 04:30 PM
In my code at some point I try to upload a matrix by using:

gl.uniformMatrix4fv(rotationMatrix, true, new WebGLFloatArray(mrot));

foolishly I had assumed that the second argument (set to true here) meant that the matrix was transposed before being uploaded (which amounts to using the normal mathematical convention for matrices and not the messed up convention of openGL).
however it does not seem to produce the desired effect. I've been unable to figure out what it really does,
and I fixed the problem by implementing a procedure transpose() to manually transpose my matrix.
but what is the meaning of the second argument, then? or is it an implementation bug? (I'm using chrome under linux)

Thanks for the help

giles
05-07-2010, 08:44 AM
That's interesting! I'd not looked at that before, and here's what the OpenGL ES 2.0 spec says:


If the transpose parameter to any of the UniformMatrix* commands is
not FALSE, an INVALID_VALUE error is generated, and no uniform values are
changed.

Very odd. Perhaps it's there for future use?