fix: use radians instead of degrees for camera zoom.

This commit is contained in:
Joey de Vries
2017-09-21 08:35:13 +02:00
parent c6b404915d
commit 2e0035a8d4
28 changed files with 28 additions and 28 deletions

View File

@@ -208,7 +208,7 @@ int main()
glViewport(0, 0, SCR_WIDTH, SCR_HEIGHT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
shader.use();
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);
glm::mat4 view = camera.GetViewMatrix();
shader.setMat4("projection", projection);
shader.setMat4("view", view);