belthil schrieb:
Then, in another application, i save those .ive files in a PagedLOD like this:
plod->addchild(osgDB::readNodeFile(StrTab[i]), 0.0, 1e20);
root->addchild(plod.get());
plod is a PagedLOD, root is the root of the scene graph and StrTab contains all the names (strings) of the .ive files. So i save all the .ive files in a loop with these two lines of code. But i have noticed something strange. For example, when the number of points in all the .ive files is N, and that there are X .ive files read, in my application there will be X*N stars... So with 1646 stars and 8 .ive files, i will have 13168 stars instead of 1646.
it looks like you are readding the ives again and again

your loop should be something like this

osg::ref_ptr<osg::Group> root = new osg::Group();

(for unsigned int i = 0; i < StrTab.size(); ++i) {
 osg::ref_ptr<osg::PageLOD> plod = new osg::PageLod();
 plod->addchild(osgDB::readNodeFile(StrTab[i]), 0.0, 1e20);
 root->addchild(plod.get());
}

If you are creating the instance of plod outside the loop you'll readd all the points again and again.

HTH,
Stephan
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to