From 0031cd08b853dda5c6e189847c50a65d2f882d44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sat, 23 Jan 2016 11:45:46 -0500 Subject: [PATCH] lib/gamnit: solve the mysterious bug "camera is 2 times too far" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/cameras.nit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gamnit/cameras.nit b/lib/gamnit/cameras.nit index df29341..a238d5f 100644 --- a/lib/gamnit/cameras.nit +++ b/lib/gamnit/cameras.nit @@ -127,7 +127,7 @@ class EulerCamera var view = new Matrix.identity(4) # Translate the world away from the camera - view.translate(-position.x/2.0, -position.y/2.0, -position.z/2.0) + view.translate(-position.x, -position.y, -position.z) # Rotate the camera, first by looking left or right, then up or down view = view * rotation_matrix @@ -227,7 +227,7 @@ class UICamera var view = new Matrix.identity(4) # Translate the world away from the camera - view.translate(-position.x/2.0, -position.y/2.0, -position.z/2.0) + view.translate(-position.x, -position.y, -position.z) # Use a projection matrix with a depth var projection = new Matrix.orthogonal(0.0, width, -height, 0.0, near, far) -- 1.7.9.5