xxxxxxxxxx
//Creating View Matrix with the glm library in C++
//The order of rotating and translateing matters
glm::vec3 position;
glm::vec3 rotation; // In radians
glm::mat4x4 view_matrix = glm::rotate(glm::mat4x4(1.0), rotation.z, glm::vec3(1, 0, 0));
view_matrix = glm::rotate(view_matrix, rotation.y, glm::vec3(0, 1, 0));
view_matrix = glm::rotate(view_matrix, rotation.x, glm::vec3(0, 0, 1));
view_matrix = glm::translate(view_matrix, -position);