Skip to content
Permalink
Browse files

[3d] Use camera-provided near/far plane values for orthographic proje…

…ction
  • Loading branch information
nirvn authored and nyalldawson committed Nov 22, 2020
1 parent 1b56825 commit 5003db68b59d8cd920d72443dca853308c7817be
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/3d/qgs3dmapscene.cpp
@@ -326,7 +326,7 @@ void Qgs3DMapScene::onCameraChanged()
QRect viewportRect( QPoint( 0, 0 ), mEngine->size() );
const float viewWidthFromCenter = mCameraController->distance();
const float viewHeightFromCenter = viewportRect.height() * viewWidthFromCenter / viewportRect.width();
mEngine->camera()->lens()->setOrthographicProjection( -viewWidthFromCenter, viewWidthFromCenter, -viewHeightFromCenter, viewHeightFromCenter, 10.0f, 10000.0f );
mEngine->camera()->lens()->setOrthographicProjection( -viewWidthFromCenter, viewWidthFromCenter, -viewHeightFromCenter, viewHeightFromCenter, mEngine->camera()->nearPlane(), mEngine->camera()->farPlane() );
}

updateScene();

0 comments on commit 5003db6

Please sign in to comment.
You can’t perform that action at this time.