glm::mat4 xxx
glm::mat4 model = glm::mat4(1.0f);
glm::mat4 view = glm::mat4(1.0f);
glm::mat4 projection = glm::mat4(1.0f);
glm::rotate glm::translate glm::perspective
model = glm::rotate(model, (float)glfwGetTime(), glm::vec3(1.0f, 0.0f, 0.0f));
view = glm::translate(view, glm::vec3(0.0f, 0.0f, -3.0f));
projection = glm::perspective(glm::radians(45.0f), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f);
实质:
- 模型变换:进行旋转操作——旋转到和世界坐标方向一样
- 观察变换:进行位移操作——相机移动=场景的反方向移动
- 投影变换:透视操作