mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
fix: use radians instead of degrees for camera zoom.
This commit is contained in:
@@ -256,7 +256,7 @@ int main()
|
||||
camera.Yaw -= 180.0f; // reset it back to its original orientation
|
||||
camera.Pitch -= 180.0f;
|
||||
camera.ProcessMouseMovement(0, 0, true);
|
||||
glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f);
|
||||
glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f);
|
||||
shader.setMat4("view", view);
|
||||
shader.setMat4("projection", projection);
|
||||
// cubes
|
||||
|
||||
Reference in New Issue
Block a user