如何将 a 转换glm::vec4为 a glm::vec3?
只有x, y,z是必需的-w可以删除组件。
在 GLSL 中,这可以使用.xyz[1] 来完成,但在 glm 中,这会导致编译错误:
error: 'glm::vec4' has no member named 'xyz'
[1] http://en.wikibooks.org/wiki/GLSL_Programming/Vector_and_Matrix_Operations#Components