summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/scatter3drenderer.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-09-19 15:11:27 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-09-20 08:56:51 +0300
commitd395b8a944b1dc7eea69c5d2b4501e71552d659e (patch)
treeee16bf4695d03e697e99819d34792c2ad37fc905 /src/datavisualization/engine/scatter3drenderer.cpp
parent14c8349dc0999f07c50504e70c91a604722eebf2 (diff)
Fix scaling of the surface
No longer will surface grid count cause scaling of the background etc. Task-number: QTRD-2267 Change-Id: I9dd62bcd6ed7b342abc8a52c7f88ed88d22ded69 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/engine/scatter3drenderer.cpp')
-rw-r--r--src/datavisualization/engine/scatter3drenderer.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/datavisualization/engine/scatter3drenderer.cpp b/src/datavisualization/engine/scatter3drenderer.cpp
index 3d385c02..38044bbe 100644
--- a/src/datavisualization/engine/scatter3drenderer.cpp
+++ b/src/datavisualization/engine/scatter3drenderer.cpp
@@ -572,20 +572,18 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle)
QMatrix4x4 depthMVPMatrix;
QMatrix4x4 itModelMatrix;
- modelMatrix.translate(0.0f, 0.0f, zComp);
#ifndef USE_UNIFORM_SCALING // Use this if we want to use autoscaling for x and z
- modelMatrix.scale(
- QVector3D(
- (aspectRatio * backgroundMargin * m_areaSize.width()) / m_scaleFactor,
- backgroundMargin,
- (aspectRatio * backgroundMargin * m_areaSize.height()) / m_scaleFactor));
+ QVector3D bgScale((aspectRatio * backgroundMargin * m_areaSize.width()) / m_scaleFactor,
+ backgroundMargin,
+ (aspectRatio * backgroundMargin * m_areaSize.height()) / m_scaleFactor);
#else // ..and this if we want uniform scaling based on largest dimension
- modelMatrix.scale(QVector3D((aspectRatio * backgroundMargin),
- backgroundMargin,
- (aspectRatio * backgroundMargin)));
+ QVector3D bgScale((aspectRatio * backgroundMargin),
+ backgroundMargin,
+ (aspectRatio * backgroundMargin));
#endif
- // We can copy modelMatrix to itModelMatrix as it has not been translated
- itModelMatrix = modelMatrix;
+ modelMatrix.translate(0.0f, 0.0f, zComp);
+ 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);