title: Matrix mult order in Direct3D
body: <p>I've received two conflicting answers in terms of multiplying matrices in Direct3D to achieve results. Tutorials do state to multiply from left to right and that's fine but it's not how I would visualize it.</p>
  
  <p>Here's an example:</p>
  
  <p>OpenGL (reading from top to bottom):</p>
  
  <pre><code>GLRotatef(90.0f);
  GLTranslatef(20.0f,0,0);
  </code></pre>
  
  <p>So you visualize the world axis rotating 30 degrees. Then you translate 20.0 on the now rotated x-axis so it looks like you are going up on the world y-axis.</p>
  
  <p>In Direct3D, doing:</p>
  
  <pre><code>wm = rotatem * translatem;
  </code></pre>
  
  <p>is different. It looks like the object was just rotated at the origin and translated on the world's x-axis so it goes to the right and not up. It only works once I reverse the order and read from right to left.</p>
  
  <p>Also for example, in frank luna's book on DX10, he goes into explaining how to do mirror reflections. I get all of that but when he does for example:</p>
  
  <pre><code>reflection_matrix = world_m * reflection_m;
  </code></pre>
  
  <p>around the xy plane, do I interpret this as first doing a the world positioning then a reflection or the opposite?</p>