wertergfdv
This commit is contained in:
@@ -66,9 +66,10 @@ public:
|
||||
}
|
||||
|
||||
glm::mat4 GetProjectionMatrix(float nearPlane, float farPlane) {
|
||||
// FOV is horizontal; convert to the vertical angle glm expects so wide screens aren't stretched
|
||||
// Quake Pro style: FOV is the horizontal angle on a 4:3 screen, so the vertical angle is fixed
|
||||
// and wider windows/fullscreen reveal more to the sides instead of zooming in.
|
||||
const float aspect = (float)window->width / (float)window->height;
|
||||
const float vfov = 2.0f * atan(tan(glm::radians(FOV) * 0.5f) / aspect);
|
||||
const float vfov = 2.0f * atan(tan(glm::radians(FOV) * 0.5f) * 3.0f / 4.0f);
|
||||
return glm::perspective(vfov, aspect, nearPlane, farPlane);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user