From: Mikko Rasa Date: Sun, 16 Nov 2014 18:06:14 +0000 (+0200) Subject: Fix orthographic projection matrix calculation X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=af7ffc9c72e30ae377476f76a51a6676dd6e89aa;p=libs%2Fgl.git Fix orthographic projection matrix calculation I made some last minute changes for c90cc1f and this got missed. --- diff --git a/source/camera.cpp b/source/camera.cpp index 6cbcf6f4..d119e1ef 100644 --- a/source/camera.cpp +++ b/source/camera.cpp @@ -105,7 +105,7 @@ void Camera::apply() const void Camera::update_projection_matrix() { - float frustum_h = tan(fov/2.0f)*clip_near; + float frustum_h = (fov!=Geometry::Angle::zero() ? tan(fov/2.0f)*clip_near : height/2); float frustum_w = frustum_h*aspect; float left = frustum_w*(frustum_x-1.0f); float right = frustum_w*(frustum_x+1.0f);