From 3347aa91e85443f78617b574b461ed841aa4f7be Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 23 Nov 2012 19:23:10 +0100 Subject: [PATCH] Fix view fit for perspective camera by setting height angle to 45 deg --- src/Gui/View3DInventorViewer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 47f3b9991..6e17e1d72 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -1378,6 +1378,11 @@ void View3DInventorViewer::viewAll() group->mode = SoSkipBoundingGroup::EXCLUDE_BBOX; } + // Set the height angle to 45 deg + SoCamera* cam = this->getCamera(); + if (cam && cam->getTypeId().isDerivedFrom(SoPerspectiveCamera::getClassTypeId())) + static_cast(cam)->heightAngle = (float)(M_PI / 4.0); + // call the default implementation first to make sure everything is visible SoQtViewer::viewAll();