title: Convert glm::vec4 to glm::vec3
body: <p>How do I convert a <code>glm::vec4</code> to a <code>glm::vec3</code>?</p>
  
  <p>Only <code>x</code>, <code>y</code>, <code>z</code> is required- the <code>w</code> component can be dropped.</p>
  
  <p>In GLSL this can be done with <code>.xyz</code>[1], but in glm this results in a compile error:</p>
  
  <pre><code>error: 'glm::vec4' has no member named 'xyz'
  </code></pre>
  
  <p>[1] <a href="http://en.wikibooks.org/wiki/GLSL_Programming/Vector_and_Matrix_Operations#Components" rel="noreferrer">http://en.wikibooks.org/wiki/GLSL_Programming/Vector_and_Matrix_Operations#Components</a></p>