Re: [osg-users] Loading of osga models dynamically?
Hi Aklin, You post just confuses me, there really isn't enough context to what you are doing to really know what is going on, and the the code itself just looks odd, for instance the self reference line: pLOD->setRange(child_no,pLOD-> > > getMinRange(child_no),pLOD->getMaxRange(child_no)); Really don't know what you expect to be happening here. I kinda get the feeling that you need learn a bit more about the concept LODs as much as the OSG API. Robert. On Mon, Apr 6, 2009 at 12:41 PM, Akilan wrote: > Hi > > I got some idea from the previous reply and did something in my > application. But I am not sure that the my following code is doing dynamic > loading, > > //On reading each node(osga file) > osg::Node *node=osgDB::readNodeFile(argv[i]); > osg::PagedLOD *pLOD=findPLOD(node); > int child_no=pLOD->getChildIndex(); > > pLOD->setRange(child_no,pLOD->getMinRange(child_no),pLOD->getMaxRange(child_no)); > group->addChild(node); > ... > ... > viewer.setSceneData(group.get()); > viewer.run(); > > If ur answer is redundant, pls execuse and get me cleared. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=9788#9788 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Loading of osga models dynamically?
Hi I got some idea from the previous reply and did something in my application. But I am not sure that the my following code is doing dynamic loading, //On reading each node(osga file) osg::Node *node=osgDB::readNodeFile(argv[i]); osg::PagedLOD *pLOD=findPLOD(node); int child_no=pLOD->getChildIndex(); pLOD->setRange(child_no,pLOD->getMinRange(child_no),pLOD->getMaxRange(child_no)); group->addChild(node); ... ... viewer.setSceneData(group.get()); viewer.run(); If ur answer is redundant, pls execuse and get me cleared. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9788#9788 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Loading of osga models dynamically?
HI Akilan, The .osga files are a distraction for this topic, it actually relates to any file format that the OSG might load. The OSG supports multi-threaded database paging using the osgDB::DatabaePager could with osg::PagedLOD / osg::ProxyNode. For you purposes you'll want to use osg::PagedLOD, decorating each of your models with a PagedLOD node with the lod ranges set so that they get loaded when you are in range of them. The OSG will do all the loaded, exprity of unsed subgraphs for you. Lots has been written about paging over the years so please go have a look at the archives. Robert. On Fri, Apr 3, 2009 at 7:34 AM, Akilan wrote: > Hi, > > > I have created virtual earth and wanted to load thousands of osga > models(each 28MB) on it. I am loading all models in the begining itself and > starting the viewer. But it keeps increase the RAM size. When the number of > models increases still more, the application fails. > > I want to know how the loading can be done dynamically? > ... > > Thank you. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=9694#9694 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Loading of osga models dynamically?
Hi, I have created virtual earth and wanted to load thousands of osga models(each 28MB) on it. I am loading all models in the begining itself and starting the viewer. But it keeps increase the RAM size. When the number of models increases still more, the application fails. I want to know how the loading can be done dynamically? ... Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9694#9694 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org