title: Rotating a vertex using transformation matrix
body: <p>I'm trying to rotate a vertex using the lwjgl <a href="http://lwjgl.org/javadoc/org/lwjgl/util/vector/Matrix4f.html" rel="nofollow">Matrix4f</a> class. I tried this code:</p>
  
  <pre><code>    float rotY = (float) Math.toRadians(180);
  
      Matrix4f transMat = new Matrix4f();
      transMat.rotate(rotY, new Vector3f(0.0f, 1.0f, 0.0f));
      transMat.translate(new Vector3f(1.0f, 0.0f, 0.0f));
  
      Vector4f vecPosMod = new Vector4f(1.0f, 0.0f, 0.0f, 1.0f);
      Matrix4f.transform(transMat, vecPosMod, vecPosMod);
  </code></pre>
  
  <p>It should rotate a <code>Vector3f(1.0f, 0.0f, 0.0f)</code> by 180 degrees but unfortunately after all calculations vecPosMod is <code>(-2.0, 0.0, 1.7484555E-7, 1.0)</code>. I want it to be <code>(-1.0, 0.0, 0.0, 1.0)</code>. How?</p>