summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/surface3drenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/datavisualization/engine/surface3drenderer.cpp')
-rw-r--r--src/datavisualization/engine/surface3drenderer.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp
index a75cf699..30ffc381 100644
--- a/src/datavisualization/engine/surface3drenderer.cpp
+++ b/src/datavisualization/engine/surface3drenderer.cpp
@@ -733,7 +733,7 @@ void Surface3DRenderer::render(GLuint defaultFboHandle)
cache->sliceSelectionPointer()->render(defaultFboHandle);
}
if (cache->mainPointerActive() && cache->renderable())
- cache->mainSelectionPointer()->render(defaultFboHandle);
+ cache->mainSelectionPointer()->render(defaultFboHandle, m_useOrthoProjection);
}
}
}
@@ -1040,8 +1040,16 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle)
// Set up projection matrix
QMatrix4x4 projectionMatrix;
- projectionMatrix.perspective(45.0f, (GLfloat)m_primarySubViewport.width()
- / (GLfloat)m_primarySubViewport.height(), 0.1f, 100.0f);
+ GLfloat viewPortRatio = (GLfloat)m_primarySubViewport.width()
+ / (GLfloat)m_primarySubViewport.height();
+ if (m_useOrthoProjection) {
+ GLfloat orthoRatio = 2.0f;
+ projectionMatrix.ortho(-viewPortRatio * orthoRatio, viewPortRatio * orthoRatio,
+ -orthoRatio, orthoRatio,
+ 0.0f, 100.0f);
+ } else {
+ projectionMatrix.perspective(45.0f, viewPortRatio, 0.1f, 100.0f);
+ }
const Q3DCamera *activeCamera = m_cachedScene->activeCamera();