From 5dfdb409f50bd12b128d5252a8a951ad437a8961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Mon, 21 Oct 2013 10:55:53 +0300 Subject: Fix grid line shadowing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I25870a86853508737b54116405c98ddf7e41e6b7 Change-Id: I25870a86853508737b54116405c98ddf7e41e6b7 Reviewed-by: Tomi Korpipää --- src/datavisualization/engine/bars3drenderer.cpp | 8 ++++++-- src/datavisualization/engine/scatter3drenderer.cpp | 8 ++++++-- src/datavisualization/engine/surface3drenderer.cpp | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp index 72e224a5..d5c9ddc5 100644 --- a/src/datavisualization/engine/bars3drenderer.cpp +++ b/src/datavisualization/engine/bars3drenderer.cpp @@ -1045,8 +1045,10 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle) itModelMatrix.scale(QVector3D(m_rowWidth / m_scaleFactor, gridLineWidth, gridLineWidth)); // If we're viewing from below, grid line object must be flipped - if (m_yFlipped) + if (m_yFlipped) { modelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + itModelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + } MVPMatrix = projectionMatrix * viewMatrix * modelMatrix; depthMVPMatrix = depthProjectionMatrix * depthViewMatrix * modelMatrix; @@ -1094,8 +1096,10 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle) m_columnDepth / m_scaleFactor)); // If we're viewing from below, grid line object must be flipped - if (m_yFlipped) + if (m_yFlipped) { modelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + itModelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + } MVPMatrix = projectionMatrix * viewMatrix * modelMatrix; depthMVPMatrix = depthProjectionMatrix * depthViewMatrix * modelMatrix; diff --git a/src/datavisualization/engine/scatter3drenderer.cpp b/src/datavisualization/engine/scatter3drenderer.cpp index a4ca528e..1da5dd99 100644 --- a/src/datavisualization/engine/scatter3drenderer.cpp +++ b/src/datavisualization/engine/scatter3drenderer.cpp @@ -719,8 +719,10 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle) #endif // If we're viewing from below, grid line object must be flipped - if (m_yFlipped) + if (m_yFlipped) { modelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + itModelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + } MVPMatrix = projectionMatrix * viewMatrix * modelMatrix; depthMVPMatrix = depthProjectionMatrix * depthViewMatrix * modelMatrix; @@ -849,8 +851,10 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle) #endif // If we're viewing from below, grid line object must be flipped - if (m_yFlipped) + if (m_yFlipped) { modelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + itModelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + } MVPMatrix = projectionMatrix * viewMatrix * modelMatrix; depthMVPMatrix = depthProjectionMatrix * depthViewMatrix * modelMatrix; diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp index 26fab440..31da7af4 100644 --- a/src/datavisualization/engine/surface3drenderer.cpp +++ b/src/datavisualization/engine/surface3drenderer.cpp @@ -1123,8 +1123,10 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle) itModelMatrix.scale(gridLineScaleX); // If we're viewing from below, grid line object must be flipped - if (m_yFlipped) + if (m_yFlipped) { modelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + itModelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + } MVPMatrix = projectionViewMatrix * modelMatrix; depthMVPMatrix = depthProjectionViewMatrix * modelMatrix; @@ -1229,8 +1231,10 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle) itModelMatrix.scale(gridLineScaleZ); // If we're viewing from below, grid line object must be flipped - if (m_yFlipped) + if (m_yFlipped) { modelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + itModelMatrix.rotate(180.0f, 1.0, 0.0, 0.0); + } MVPMatrix = projectionViewMatrix * modelMatrix; depthMVPMatrix = depthProjectionViewMatrix * modelMatrix; -- cgit v1.2.3