title: Method of transforming 3D vectors with a matrix
body: <p>I've been doing some reading on transforming Vector3 with matrices, and am tossing up digging deeper into the math and coding this myself versus using existing code.  For whatever reason my school curriculum never included matrices, so I'm filling a gap in my knowledge.  Thankfully I only need a few simple things, I think.</p>
  
  <p>Context is that I'm programming a robot for the <a href="http://www.youtube.com/watch?v=hitSyiQ9iqg" rel="nofollow noreferrer">RoboCup 3D league</a>.  I'm coding it in C# but it'll have to run on Mono.  Ideally I wouldn't use any existing graphics libraries for this (WinForms/WPF/XNA) as all I really need is a neat subset of matrix transformations.</p>
  
  <p>Specifically, I need translation and x/y/z rotations, and a way of combining multiple transformations into a single matrix.  This will then be applied to my own <code>Vector3</code> type to produce the transformed <code>Vector3</code>.</p>
  
  <p>I've read different advice about this.  For example, <a href="http://www.oocities.com/evilsnack/matrix.htm" rel="nofollow noreferrer">some</a> model the transformation with a 4x3 matrix, <a href="http://gpwiki.org/index.php/3D:Matrix_Math" rel="nofollow noreferrer">others</a> with a 4x4 matrix.</p>
  
  <p>Also, some examples show that you need a forth value for the vector's matrix of 1.  What happens to this value when it's included in the output?</p>
  
  <pre>
              [1 0 0 0]
  [x y z 1] * [0 1 0 0] = [a b c d]
              [0 0 1 0]
              [2 4 6 1]
  </pre>
  
  <p>The parts I'm missing are:</p>
  
  <ul>
  <li>What sizes my matrices should be</li>
  <li>Compositing transformations by multiplying the transformation matrices together</li>
  <li>Transforming 3D vectors with the resulting matrix</li>
  </ul>
  
  <p>As I mostly just want to get this running, any psuedo-code would be great.  Information about what matrix values perform what transformations is quite clearly defined on many pages, so need not be discussed here unless you're very keen :)</p>