Commit 0dd536d9 authored by Matthias Möller's avatar Matthias Möller

analyze scenegraph before translating the camera and remove scene analysis, after translation

closes #2221

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19149 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 49f386f2
......@@ -917,6 +917,16 @@ void glViewer::viewAll()
// update scene graph (get new bounding box and set projection right, including near and far plane)
properties_.lockUpdate();
unsigned int maxPases = 1;
ACG::Vec3d bbmin,bbmax;
// update scene bounding boxes
ACG::SceneGraph::analyzeSceneGraph(PluginFunctions::getSceneGraphRootNode(),maxPases,bbmin,bbmax);
// update scene properties (near, far plane, scene radius according to the computed bounding boxes)
sceneGraph ( PluginFunctions::getSceneGraphRootNode(), maxPases,bbmin,bbmax,true);
// update camera
// move center (in camera coords) to origin and translate in -z dir
translate(-(glstate_->modelview().transform_point(properties_.sceneCenter()))
- ACG::Vec3d(0.0, 0.0, 3.0 * properties_.sceneRadius()));
......@@ -926,12 +936,6 @@ void glViewer::viewAll()
if (aspect > 1.0)
properties_.orthoWidth( aspect * properties_.orthoWidth() ) ;
unsigned int maxPases = 1;
ACG::Vec3d bbmin,bbmax;
ACG::SceneGraph::analyzeSceneGraph(PluginFunctions::getSceneGraphRootNode(),maxPases,bbmin,bbmax);
sceneGraph ( PluginFunctions::getSceneGraphRootNode(), maxPases,bbmin,bbmax,true);
properties_.unLockUpdate();
updateProjectionMatrix();
updateGL();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment