summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-10-21 10:23:16 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-10-21 10:26:25 +0300
commit65969b200b94a6b2a47eb63228a3852ee4284f8f (patch)
tree4db56303ea03a49e4841f9f2d777cd54226401f9 /src
parent298e5e4ab12d8542c42bf4ed9118ab3f579d8456 (diff)
Background lighting fix
Task-number: QTRD-2482 Change-Id: Ifb7bf95a7ff1da7adea3a40ce54855d915a803a2 Change-Id: Ifb7bf95a7ff1da7adea3a40ce54855d915a803a2 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/datavisualization/engine/bars3drenderer.cpp1
-rw-r--r--src/datavisualization/engine/meshes/backgroudFlat.obj30
-rw-r--r--src/datavisualization/engine/meshes/backgroudNegatives.obj24
-rw-r--r--src/datavisualization/engine/meshes/backgroudSmooth.obj6
-rw-r--r--src/datavisualization/engine/scatter3drenderer.cpp2
-rw-r--r--src/datavisualization/engine/surface3drenderer.cpp3
6 files changed, 32 insertions, 34 deletions
diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp
index a7dcb70f..72e224a5 100644
--- a/src/datavisualization/engine/bars3drenderer.cpp
+++ b/src/datavisualization/engine/bars3drenderer.cpp
@@ -960,6 +960,7 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
itModelMatrix.scale(QVector3D(m_rowWidth / m_scaleFactor,
1.0f,
m_columnDepth / m_scaleFactor));
+ itModelMatrix.rotate(backgroundRotation, 0.0f, 1.0f, 0.0f);
#ifdef SHOW_DEPTH_TEXTURE_SCENE
MVPMatrix = depthProjectionMatrix * depthViewMatrix * modelMatrix;
diff --git a/src/datavisualization/engine/meshes/backgroudFlat.obj b/src/datavisualization/engine/meshes/backgroudFlat.obj
index cf4d10a5..5eeb1f26 100644
--- a/src/datavisualization/engine/meshes/backgroudFlat.obj
+++ b/src/datavisualization/engine/meshes/backgroudFlat.obj
@@ -5,23 +5,23 @@ v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
-v 0.999999 1.000000 1.000001
+v 1.000000 1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
-vt 0.000000 0.501529
-vt 0.001529 1.000000
-vt 0.500000 0.998471
-vt 0.501529 0.500000
-vt 1.000000 0.498471
-vt 0.998471 0.000000
-vt 0.500000 0.498471
-vt 0.498471 0.000000
-vt 0.000000 0.001529
-vt 0.498471 0.500000
-vt 0.500000 0.001529
-vt 0.001529 0.500000
-vn -0.000000 1.000000 0.000000
-vn 0.000000 -0.000000 -1.000000
+vt 0.000000 0.500000
+vt 0.000000 1.000000
+vt 0.500000 1.000000
+vt 0.500000 0.500000
+vt 1.000000 0.500000
+vt 1.000000 0.000000
+vt 0.500000 0.500000
+vt 0.500000 0.000000
+vt 0.000000 0.000000
+vt 0.500000 0.500000
+vt 0.500000 0.000000
+vt 0.000000 0.500000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 0.000000 -1.000000
vn 1.000000 0.000000 0.000000
s off
f 1/1/1 4/2/1 3/3/1
diff --git a/src/datavisualization/engine/meshes/backgroudNegatives.obj b/src/datavisualization/engine/meshes/backgroudNegatives.obj
index dd4d3f05..4153bfd4 100644
--- a/src/datavisualization/engine/meshes/backgroudNegatives.obj
+++ b/src/datavisualization/engine/meshes/backgroudNegatives.obj
@@ -5,7 +5,7 @@ v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
-v 0.999999 1.000000 1.000001
+v 1.000000 1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 -3.000000 1.000000
@@ -21,17 +21,13 @@ vt 0.666500 0.000100
vt 0.666500 0.666500
vt 0.000100 0.999900
vt 0.000100 0.666500
-vn 0.000000 0.999969 0.000000
-vn 0.000000 1.000000 0.000000
-vn 0.000000 0.000000 -1.000000
-vn 0.707083 0.000000 -0.707083
+vn -0.000000 1.000000 0.000000
+vn 0.000000 -0.000000 -1.000000
vn 1.000000 0.000000 0.000000
-vn 0.999969 0.000000 0.000000
-vn 0.000000 0.000000 -0.999969
-s 1
-f 1/1/1 4/2/2 3/3/2
-f 8/4/3 9/5/4 6/6/4
-f 9/5/4 10/7/5 7/8/6
-f 2/9/2 1/1/1 3/3/2
-f 5/10/7 8/4/3 6/6/4
-f 6/6/4 9/5/4 7/8/6
+s off
+f 1/1/1 4/2/1 3/3/1
+f 8/4/2 9/5/2 6/6/2
+f 9/5/3 10/7/3 7/8/3
+f 2/9/1 1/1/1 3/3/1
+f 5/10/2 8/4/2 6/6/2
+f 6/6/3 9/5/3 7/8/3
diff --git a/src/datavisualization/engine/meshes/backgroudSmooth.obj b/src/datavisualization/engine/meshes/backgroudSmooth.obj
index ad16d904..27d06aea 100644
--- a/src/datavisualization/engine/meshes/backgroudSmooth.obj
+++ b/src/datavisualization/engine/meshes/backgroudSmooth.obj
@@ -5,7 +5,7 @@ v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
-v 0.999999 1.000000 1.000001
+v 1.000000 1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vt 0.000000 0.501529
@@ -20,12 +20,12 @@ vt 0.000000 0.001529
vt 0.498471 0.500000
vt 0.500000 0.001529
vt 0.001529 0.500000
-vn 0.000000 0.999969 0.000000
+vn 0.000000 1.000000 0.000000
vn 0.707083 0.707083 0.000000
vn 0.577349 0.577349 -0.577349
vn 0.000000 0.707083 -0.707083
vn 0.707083 0.000000 -0.707083
-vn 0.999969 0.000000 0.000000
+vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 -1.000000
s 1
f 1/1/1 4/2/2 3/3/3
diff --git a/src/datavisualization/engine/scatter3drenderer.cpp b/src/datavisualization/engine/scatter3drenderer.cpp
index 43a86be3..a4ca528e 100644
--- a/src/datavisualization/engine/scatter3drenderer.cpp
+++ b/src/datavisualization/engine/scatter3drenderer.cpp
@@ -600,7 +600,6 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle)
(aspectRatio * backgroundMargin));
#endif
modelMatrix.scale(bgScale);
- itModelMatrix.scale(bgScale);
// If we're viewing from below, background object must be flipped
if (m_yFlipped) {
modelMatrix.rotate(180.0f, 1.0, 0.0, 0.0);
@@ -608,6 +607,7 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle)
} else {
modelMatrix.rotate(backgroundRotation, 0.0f, 1.0f, 0.0f);
}
+ itModelMatrix = modelMatrix; // Only scaling and rotations, can be used directly
#ifdef SHOW_DEPTH_TEXTURE_SCENE
MVPMatrix = depthProjectionMatrix * depthViewMatrix * modelMatrix;
diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp
index 4ce8d2c7..26fab440 100644
--- a/src/datavisualization/engine/surface3drenderer.cpp
+++ b/src/datavisualization/engine/surface3drenderer.cpp
@@ -1027,7 +1027,6 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle)
QVector3D bgScale(m_scaleXWithBackground, backgroundMargin, m_scaleZWithBackground);
modelMatrix.scale(bgScale);
- itModelMatrix.scale(bgScale);
// If we're viewing from below, background object must be flipped
if (m_yFlipped) {
@@ -1037,6 +1036,8 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle)
modelMatrix.rotate(backgroundRotation, 0.0f, 1.0f, 0.0f);
}
+ itModelMatrix = modelMatrix; // Only scaling and rotations, can be used directly
+
#ifdef SHOW_DEPTH_TEXTURE_SCENE
MVPMatrix = depthProjectionViewMatrix * modelMatrix;
#else