title: Transformation matrix issues
body: <p>I'm learning about computer graphics through <a href="http://www.youtube.com/playlist?list=PLEETnX-uPtBXP_B2yupUKlflXBznWIlL5/" rel="nofollow">modern OpenGL tutorials</a>, and I'm having issues refactoring my code from GLM to a custom matrix math class. Using GLM I can achieve the desired effect (which is a pyramid-like shape rotating across the screen); however, using my math class I cannot get the correct transformation. For reference, <a href="http://imgur.com/1pK5YpE" rel="nofollow">this</a> is what the transformation looks like with my math class. Using GLM the shape will translate along the x-axis (horizontally) which is what I want. I assume the GLSL code is correct since it works with the GLM code. </p>
  
  <p>In my <code>Transform</code> class, I have a function that returns a model matrix and which maps to the corresponding uniform variable in my shader class. </p>
  
  <pre><code>Matrix4f Transform::getModel() const // my math class - not working
  {
      Matrix4f transMat, rotMat, scaleMat;
      transMat.initTranslation(trans.x, trans.y, trans.z);
      rotMat.initRotation(rot.x, rot.y, rot.z);
      scaleMat.initScale(scale.x, scale.y, scale.z);
  
      return transMat * rotMat * scaleMat;
  }
  
  glm::mat4 Transform::getModel() const // glm - works fine
  {
      glm::mat4 transMat = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
      glm::mat4 scaleMat = glm::scale(glm::vec3(scale.x, scale.y, scale.z));
      glm::mat4 rotX = glm::rotate(rot.x, glm::vec3(1.0, 0.0, 0.0));
      glm::mat4 rotY = glm::rotate(rot.y, glm::vec3(0.0, 1.0, 0.0));
      glm::mat4 rotZ = glm::rotate(rot.z, glm::vec3(0.0, 0.0, 1.0));
      glm::mat4 rotMat = rotX * rotY * rotZ;
  
      return transMat * rotMat * scaleMat;
  }
  </code></pre>
  
  <p>I think the problem lies in my <code>Matrix4&lt;T&gt;</code> class, but there's quite a bit of code to show so I will <a href="https://github.com/zmertens/BennyBoxEngine-SFML/blob/develop/include/Matrix4.hpp" rel="nofollow">link.</a> The Matrix class is based on the tutorials I linked above.</p>
  
  <p>P.S. If you're wondering why I'm using a custom math class instead of GLM it is for learning purposes (I realize GLM is much more suited for this than my untested library).</p>