diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-08-22 09:19:34 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-08-22 09:22:40 +0300 |
commit | 00a2a1a980cc2ff1ede0d8dd7ea9d92a06bd957e (patch) | |
tree | 61f1901d78165aaebab2a2fbb599ef888d86dd76 /src/datavis3d/engine | |
parent | b97950d9f1caf4d22ec95c4daef224fce2d7c10e (diff) |
Flipped scatter z-axis drawing
Task-number: QTRD-2204
Change-Id: I5e3e805ef05e4219e3b66a37cf2c3a98273f4be5
Change-Id: I5e3e805ef05e4219e3b66a37cf2c3a98273f4be5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src/datavis3d/engine')
-rw-r--r-- | src/datavis3d/engine/scatter3drenderer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/datavis3d/engine/scatter3drenderer.cpp b/src/datavis3d/engine/scatter3drenderer.cpp index 1b8996da..ec851198 100644 --- a/src/datavis3d/engine/scatter3drenderer.cpp +++ b/src/datavis3d/engine/scatter3drenderer.cpp @@ -46,8 +46,6 @@ QT_DATAVIS3D_BEGIN_NAMESPACE //#define USE_UNIFORM_SCALING // Scale x and z uniformly, or based on autoscaled values -#define DISPLAY_FULL_DATA_ON_SELECTION // Append selection value text with row and column labels - const GLfloat aspectRatio = 2.0f; // Forced ratio of x and z to y. Dynamic will make it look odd. // TODO: Make margin modifiable? const GLfloat backgroundMargin = 1.1f; // Margin for background (1.1f = make it 10% larger to avoid items being drawn inside background) @@ -1107,11 +1105,11 @@ void Scatter3DRenderer::drawScene(CameraHelper *camera, if (m_axisCacheZ.segmentCount() > 0) { #ifndef USE_UNIFORM_SCALING GLfloat posStep = aspectRatio * m_axisCacheZ.segmentStep(); - GLfloat labelPos = aspectRatio * m_axisCacheZ.min(); + GLfloat labelPos = aspectRatio * m_axisCacheZ.max(); int lastSegment = m_axisCacheZ.segmentCount(); #else GLfloat posStep = aspectRatio * axisCacheMax->segmentStep(); - GLfloat labelPos = -aspectRatio * m_scaleFactor; + GLfloat labelPos = aspectRatio * m_scaleFactor; int lastSegment = axisCacheMax->segmentCount(); #endif int labelNbr = 0; @@ -1161,7 +1159,7 @@ void Scatter3DRenderer::drawScene(CameraHelper *camera, alignment); } labelNbr++; - labelPos += posStep; + labelPos -= posStep; } } // X Labels @@ -1416,7 +1414,7 @@ void Scatter3DRenderer::calculateTranslation(ScatterRenderItem &item) // We need to normalize translations GLfloat xTrans = (aspectRatio * item.position().x()) / m_scaleFactor; - GLfloat zTrans = (aspectRatio * item.position().z()) / m_scaleFactor; + GLfloat zTrans = -(aspectRatio * item.position().z()) / m_scaleFactor; GLfloat yTrans = item.position().y() / m_heightNormalizer; item.setTranslation(QVector3D(xTrans, yTrans, zTrans + zComp)); //qDebug() << item.translation(); |