Skip to content

Commit

Permalink
[3d] Use camera-provided near/far plane values for orthographic proje…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
nirvn authored and nyalldawson committed Nov 22, 2020
1 parent 1b56825 commit 5003db6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/3d/qgs3dmapscene.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 5003db6

Please sign in to comment.