From 8f7cb17eb66e11cebf3702c804da5f46a54b6bf2 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Fri, 14 Mar 2014 02:27:40 -0700 Subject: [PATCH] Default Z value to 0 and reverse the value, so positive Z is closer to the viewer --- project/src/common/Display.cpp | 3 +-- project/src/renderer/opengl/OpenGLS3D.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/project/src/common/Display.cpp b/project/src/common/Display.cpp index 75a1036a5..a53eb27c4 100644 --- a/project/src/common/Display.cpp +++ b/project/src/common/Display.cpp @@ -30,8 +30,7 @@ DisplayObject::DisplayObject(bool inInitRef) : Object(inInitRef) mParent = 0; mGfx = 0; mDirtyFlags = 0; - x = y = 0; - z = 0.1; + x = y = z = 0; scaleX = scaleY = 1.0; rotation = 0; visible = true; diff --git a/project/src/renderer/opengl/OpenGLS3D.cpp b/project/src/renderer/opengl/OpenGLS3D.cpp index 44d4cd7c3..dfed22f79 100644 --- a/project/src/renderer/opengl/OpenGLS3D.cpp +++ b/project/src/renderer/opengl/OpenGLS3D.cpp @@ -272,7 +272,7 @@ void OpenGLS3D::FocusEye (Trans4x4 &outTrans) { outTrans[0][0] = (a*n); outTrans[0][1] = (b*n); outTrans[0][2] = m; - outTrans[0][3] = (n*tx + m*tz); + outTrans[0][3] = (n*tx + m*-tz); outTrans[1][0] = c; outTrans[1][1] = d; @@ -282,7 +282,7 @@ void OpenGLS3D::FocusEye (Trans4x4 &outTrans) { outTrans[2][0] = -a*m; outTrans[2][1] = -b*m; outTrans[2][2] = -n; - outTrans[2][3] = -(n*tz-m*tx); + outTrans[2][3] = -(n*-tz-m*tx); } }