[osg-users] [forum] add/remove nodes when rendering

Sophie Audonneau sophie.audonneau1 at etu.univ-lorraine.fr
Tue Apr 14 07:15:54 PDT 2015

Thank you both for your answers !

Robert :

Having databases in the background could be a good solution, I had not thought about it. However I have looked at the functioning of osgDB::DatabasePager but as I'm not very familiar with its use I can't see clearly how it could be incorporated in my application. 
I currently ask the user to specify which files he wants to load (through a file browser) and then use readNodeFile to get the osg::Nodes associated to each file. From what I saw, in the DatabasePager, readNode is called internally from the filecache and I don't really see how it can be integrated. To remove/hide specified data from the scenegraph is it necessary to specify an expiryTime or is it possible to point out the node that must be remove (as in removeChild(osg::Node*)) ? I didn't find a lot of examples of use of the DatabasePager, do you think of one I could use to gain a better understanding of that tool ?

Jan :

OpenSceneGraph is actually included in another application, which have its own openGl parameters that's why I get back some view parameters and matrices.
At first I called setUpViewerAsEmbeddedInWindow and getCamera inside the singleton when I created the viewer as it seemed logical but it didn't work. I tried several configurations and surprisingly realised that with those calls at each frame() it seemed to work properly (at least I can load several files and display them in my viewer) but I don't understand why it works that way and it is obviously not very efficient.



Read this topic online here:

More information about the osg-users mailing list