3
如何在一個軸上旋轉攝像頭?我必須乘以什麼矩陣?圍繞一個軸旋轉攝像頭?
我正在使用glm :: lookAt來構建viewMatrix,但我試圖乘以旋轉矩陣並沒有發生任何事情。
glm::mat4 GetViewMatrix()
{
return glm::lookAt(this->Position, this->Position + this->Front, glm::vec3(0.0f, 5.0f, 0.0f));
}
glm::mat4 ProjectionMatrix = glm::perspective(actual_camera->Zoom, (float)g_nWidth/(float)g_nHeight, 0.1f, 1000.0f);
glm::mat4 ViewMatrix = actual_camera->GetViewMatrix();
glm::mat4 ModelMatrix = glm::mat4(1.0);
glm::mat4 MVP = ProjectionMatrix * ViewMatrix * ModelMatrix;