Hi,

I need to get the best heightfield reading I can out of an osgTerrain database 
at runtime. At the moment I am doing something like this:


Code:
osg::Node *pNode = osgDB::readNodeFile((const char *)fname_local);
// Top level node should be a coordinate system node
osg::CoordinateSystemNode *pCoordSystem = 
dynamic_cast<osg::CoordinateSystemNode*>(pNode);
// next node down should be a PageLOD
osg::PagedLOD *pLod = dynamic_cast<osg::PagedLOD*>(pCoordSystem->getChild(0));
osgTerrain::TerrainTile *pTopTile = 
dynamic_cast<osgTerrain::TerrainTile*>(pLod->getChild(0));
m_pLayer = pTopTile->getElevationLayer();

... Then

m_pLayer->getLocator()->convertModelToLocal(Model, Local);
// Get the Altitude
m_pLayer->getInterpolatedValue(Local.x(), Local.y(), fAltitude);



What I would really like to do is to drill down to the best LOD, ensure that 
that heightfield tile is loaded and query it directly

Has anyone got any tips or example code on how to do this.

Thank you!

Cheers,
Roger[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=34503#34503





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to