Hello Bastian, Bastian Sdorra wrote: > I've a problem with OpenSG2 SceneFileHandler stl-modelloading. > In release mode everything is fine, in debug mode I get something from > the read function, but the volume values are always wrong. > > Here is a small example: > > int main(int argc, char **argv) > { > // Init the OpenSG subsystem > osgInit(argc,argv); > preloadSharedObject("OSGFileIO"); > preloadSharedObject("OSGImageFileIO"); > { > int winid = setupGLUT(&argc, argv); > GLUTWindowRecPtr gwin = GLUTWindow::create(); > gwin->setGlutId(winid); > gwin->init(); > > NodeRefPtr n = SceneFileHandler::the()->read("3D-ScanII.stl");
please insert a commitChanges() call here. The bounding volume is updated lazily when modifying the scenegraph (they are invalidated immediately, but the recomputation is lazy). Since this has come up before we should probably insert the call at the end of loading, I'll take care of that. > if(!n) > std::cout << "error: no mesh loaded" << std::endl; > > mgr = new SimpleSceneManager; > mgr->setWindow(gwin); > mgr->setRoot(n); > mgr->showAll(); > > const BoxVolume &vol = n->getVolume(); > Pnt3f volMin, volMax; > vol.getBounds(volMin, volMax); > > std::cout << volMin << std::endl; > std::cout << volMax << std::endl; > } > glutMainLoop(); > return 0; > } > > > Here's the output: > > Release: > -5.35074, -80.7023, 1.59258 > 67.8868, -17.9534, 20.4607 > > Debug: > -1.07374e+008, -1.07374e+008, -1.07374e+008 > 67.8868, -17.9534, 20.4607 > > > The volMin output for debug is always the same, also for other meshes. > I don't have this problem for other fileformats, .obj for example. hm, I have no idea why only the debug libs are affected, but it may be a coincidence that the release libs give the expected answer. Cheers, Carsten ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users