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