HI Akilan,

It kinda looks like you creating a scene graph that either uses the
low res whole earth model or a group of high res tiles that all site
in a single flat group.  This is *really* inefficient way to build
your scene graph.

The proper way to build paged databases is to build a quad tree
database.  I don't know if the concept of quad tree is familiar to you
so don't know how much to explain.  Wriiting software that creates
decent terrain paged databases is not a trivial matter, rather than
create it yourself you should considering using a 3rd party tool to do
it for you.  For instance VirtualPlanetBuilder is designed to
generated whole earth paged database that can be browsed with OSG
apps.  osgEarth and ossimPlanet also can generated paged databases on
the fly for you.

Robert.

On Wed, Apr 22, 2009 at 6:41 AM, Akilan <akilan.thangam...@gmail.com> wrote:
> Hi
>
> The following is the environment which i am working on,
>
> Hardware configuration:
>
>        HP xw4400 Workstation
>        Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz, 2GB RAM
>        NVIDIA Quadro FX 3500
>
>
> OS:
>        MS Windows XP Professional Version 2002
>        Service Pack 3, v.3244
>
> OSG:
>        OSG2.2
>
> The following set of code shows about how I am building scene graph for 
> terrian visualization,
>
> //the file"TerrainModels.txt" Contains list of terrain models(.osga files) 
> with absolute path
> //all are geographic models with datum 'WGS-84' and 'UTM' projection
>
> ifstream fin("TerrainModels.txt");
> while(!fin.eof()){
>        fin>>str;
>        if(strstr(str,".osga")!=NULL){
>           osg::ref_ptr<osg::Fog> fog=new osg::Fog;
>           fog->setColor(osg::Vec4(.45,.45,.45,1.));
>           fog->setStart(0.f);
>           fog->setEnd(50.f);
>           fog->setDensity(1.f);
>           fog->setMode(osg::Fog::LINEAR);
>           fog->setFogCoordinateSource(osg::Fog::FRAGMENT_DEPTH);
>
>           osg::StateSet *statSet=new osg::StateSet();
>           statSet->setMode(GL_BLEND,osg::StateAttribute::ON);
>           statSet->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
>           statSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
>           statSet->setAttributeAndModes(fog.get(),osg::StateAttribute::ON);
>
>          osg::PagedLOD *plod = new osg::PagedLOD();
>          plod->setName(str);
>          plod->setRangeMode(osg::PagedLOD::DISTANCE_FROM_EYE_POINT);
>          plod->setFileName(0, str);
>          plod->setPriorityOffset(0, 1.f);
>          plod->setPriorityScale(0, 1.f);
>          plod->setRange(0, 50.f, 100.f);
>          plod->setStateSet(statSet);
>          group->addChild(plod);
>        }else if(strstr(str,"bluemarble.ive")==0)  //for specifically adding 
> virtual earth
>                group->addChild(osgDB::readNodeFile(str));
> }
> fin.close();
>
> osgViewer::Viewer viewer;
> osgUtil::Optimizer optimzer;
>
> optimzer.optimize(group.get());
> viewer.setSceneData(group.get());
> viewer.addEventHandler( new 
> osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
> viewer.addEventHandler(new osgViewer::ThreadingHandler);
> viewer.setCameraManipulator(new osgGA::TerrainManipulator());
>
> viewer.realize();
> while(!viewer.done()){
>        viewer.frame();
> }
>
> Let me explain the problem,
> I am trying to load around 8000-9000 osg terrain models which are covering 
> part of india.
> As I have set the PagedLOD range 50-100, when I enter the range(zooming-down 
> thru virtual earth), all the terrain models start loading and from that range 
> onwards I am not able to zoom-down freely. It becomes very slow  and the view 
> also jerks.
>
> Please correct me.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10589#10589
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to