I have crossed some very simple error while started using glm (in VS2010). I have got this short code:
glm::mat4 translate = glm::translate(glm::mat4(1.f), glm::vec3(2.f, 0.f, 0.f));
glm::vec4 vector(1.f,1.f,1.f,0.f);
glm::vec4 transformedVector = translate * vector;
The result of the transformedVector is the same as its original value (1.f, 1.f, 1.f, 0.f). I do not know what i am missing here. I have tried the rotation matrix and that is working fine, the point is transformated correctly.
glm::mat4 rotate = glm::rotate(glm::mat4(1.f), 90.f, glm::vec3(0.f, 0.f, 1.f));
glm::vec4 vector(1.f, 1.f, 1.f, 0.f);
glm::vec4 transformedVector = rotate * vector;
Ok, I have found out the problem. I would like to translate a vertex not a vector, in this case I had to set the w value to 1.