title: Does WebGL matrix (mat4) notation corresponds to mathematical matrix notation
body: <p>Documentation for <a href="https://www.khronos.org/files/opengles_shading_language.pdf" rel="nofollow noreferrer">The OpenGL ES Shading Language</a> (section 5.11) states that vector and matrix multiplcation operations performs in the correct linear algebraic way.
  Linear algebra teaches if we multiply matrix by vector we get such result:</p>
  
  <pre><code>1.0 1.0 0.0   -1.0   (1.0*-1.0)+(1.0*0.0)+(0.0*0.0)=-1.0
  0.5 0.0 0.0 *  0.0 = (0.5*-1.0)+(0.0*0.0)+(0.0*0.0)=-0.5
  0.0 0.0 0.0    0.0   (0.0*-1.0)+(0.0*0.0)+(0.0*0.0)= 0.0
  
  1.0 1.0 0.0    0.0    1.0
  0.5 0.0 0.0 *  1.0 =  0.0
  0.0 0.0 0.0    0.0    0.0
  
  1.0 1.0 0.0    1.0    1.0
  0.5 0.0 0.0 *  0.0 =  0.5
  0.0 0.0 0.0    0.0    0.0
  </code></pre>
  
  <p>But when I use this mathematical knowledge for multiplication matrix by vector in WebGL vertex-shader I face with problem.
  When I try multiply analogue of above matrix:</p>
  
  <pre><code>mat4 matrix=mat4(
  1.0, 1.0, 0.0, 0.0,
  0.5, 0.0, 0.0, 0.0,
  0.0, 0.0, 1.0, 0.0,
  0.0, 0.0, 0.0, 1.0);
  </code></pre>
  
  <p>to three verticles: red(x=-1,y=0,z=0,w=1), green(x=0,y=1,z=0,w=1), blue(x=1,y=0,z=0,w=1) of simplest isosceles triangle I get strange practical coordinates: red(-1,-1,0,1), green(0.5,0,0,1), blue(1,1,0,1), instead of the expected from above theoretical calculations: red(-1,-0.5,0,1), green(1,0,0,1), blue(1,0.5,0,1). Source code that demonstrates problem is <a href="http://acadyt.scienceontheweb.net/webgl_multiplication.htm" rel="nofollow noreferrer">avaliable here</a>.</p>
  
  <p>These strange coordinates will be matematically correct only if assume that mat4 matrix was auto-transposed before multiplication (documentation for The OpenGL ES Shading Language states that OpenGL stores matrix data in column major order: may be this is the reason?).</p>
  
  <p>So, the question, does WebGL notation</p>
  
  <pre><code>mat4 matrix=mat4(
  1.0, 1.0, 0.0, 0.0,
  0.5, 0.0, 0.0, 0.0,
  0.0, 0.0, 1.0, 0.0,
  0.0, 0.0, 0.0, 1.0);
  </code></pre>
  
  <p>mean in mathematical sense such matrix as:</p>
  
  <pre><code>1.0 0.5 0.0 0.0
  1.0 0.0 0.0 0.0
  0.0 0.0 1.0 0.0
  0.0 0.0 0.0 1.0
  </code></pre>
  
  <p>or not? Should I believe my eyes or documentation?</p>