title: How to represent a 4x4 matrix rotation?
body: <p>Given the following definitions for x,y,z rotation matrices, how do I represent this as one complete matrix? Simply multiply x, y, &amp; matrices?  </p>
  
  <p>X Rotation:  </p>
  
  <pre><code>[1 0 0 0]
  [0 cos(-X Angle) -sin(-X Angle) 0]
  [0 sin(-X Angle) cos(-X Angle) 0]
  [0 0 0 1]
  </code></pre>
  
  <p>Y Rotation:  </p>
  
  <pre><code>[cos(-Y Angle) 0 sin(-Y Angle) 0]
  [0 1 0 0]
  [-sin(-Y Angle) 0 cos(-Y Angle) 0]
  [0 0 0 1]
  </code></pre>
  
  <p>Z Rotation:  </p>
  
  <pre><code>[cos(-Z Angle) -sin(-Z Angle) 0 0]
  [sin(-Z Angle) cos(-Z Angle) 0 0]
  [0 0 1 0]
  [0 0 0 1] 
  </code></pre>
  
  <p><strong>Edit:</strong> I have a separate rotation class that contains an x, y, z float value, which I later convert to a matrix in order to combine with other translations / scales / rotations.</p>
  
  <p>Judging from the answers here, I can assume that if I do something like:</p>
  
  <p>Rotation rotation;
  rotation.SetX(45);
  rotation.SetY(90);
  rotation.SetZ(180);</p>
  
  <p>Then it's actually really important as to which order the rotations are applied? Or is it safe to make the assumption that when using the rotation class, you accept that they are applied in x, y, z order?</p>