title: How to pass and use 4x4 transformation matrix into vShader with glUniformMatrix4fv?
body: <p>Im sure there is a better way for me to calculate my transformation matrix from a quaternion but this is what i have for now.  I need to pass the 16 values into the shader but am having an issue.  I keep getting type incompatibility errors.  Also once i get it in there do i have to do anything to it to multiply it to what i already have?</p>
  
  <p>Here is my display and shader</p>
  
  <pre><code>void display()
  {    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
  if (trackballMove) 
  {
     glRotatef(angle, axis[0], axis[1], axis[2]);
  }
  //colorcube();
  glUniform3fv( theta, 1, Theta );
  
  float a = angle;
  float b = axis[0];
  float c = axis[1];
  float d = axis[2];
  float xform[16] = {(a*a+b*b-c*c-d*d),(2*b*c-2*a*d),(2*b*d+2*a*c),0.0,
  (2*b*c+2*a*d),(a*a-b*b+c*c-d*d),(2*c*d-2*a*b),0.0,
  (2*b*d-2*a*c),(2*c*d+2*a*b),(a*a-b*b-c*c+d*d),0.0,
  0.0,0.0,0.0,1.0};
          GLuint Transform = glGetUniformLocation( program, "vTransform");
          glUniformMatrix4fv(Transform,  xform);
  glDrawArrays( GL_TRIANGLES, 0, NumVertices );
  glutSwapBuffers();
  }    
  </code></pre>
  
  <p>here is the shader</p>
  
  <pre><code>#version 150
  in vec4 vPosition;
  in vec4 vColor;
  out vec4 color;
  uniform vec3 theta;
  uniform vec4 vTransform;
  
  void main()
  {
  // Compute the sines and cosines of theta for each of
  // the three axes in one computation.
  vec3 angles = radians( theta );
  vec3 c = cos( angles );
  vec3 s = sin( angles );
  
  // Remember: these matrices are column-major
  mat4 rx = mat4( 1.0, 0.0, 0.0, 0.0,
  0.0, c.x, -s.x, 0.0,
  0.0, s.x, c.x, 0.0,
  0.0, 0.0, 0.0, 1.0 );
  mat4 ry = mat4( c.y, 0.0, s.y, 0.0,
  0.0, 1.0, 0.0, 0.0,
  -s.y, 0.0, c.y, 0.0,
  0.0, 0.0, 0.0, 1.0 );
  mat4 rz = mat4( c.z, -s.z, 0.0, 0.0,
  s.z, c.z, 0.0, 0.0,
  0.0, 0.0, 1.0, 0.0,
  0.0, 0.0, 0.0, 1.0 );
  color = vColor;
  
  gl_Position = vTransform *(rx * ry * rz * vPosition);
  }
  </code></pre>