Hi All,
It's been a while. Good to be back.
We have created a paged terrain database using VPB/OsgDem with geo-referenced
GeoTIFF-based elevation data using the command:
osgdem -d honolulu.tif --no-terrain-simplification -l 16 -o honolulu.ive
This creates a very detailed terrain database against which we'd like to
perform HAT queries.
We build a simple scene graph using the following lines of code:
osg::Node *wTerrainNode = osgDB::readNodeFile( "honolulu.ive" );
osg::Group *wRootNode = new osg::Group();
wRootNode->addChild( wTerrainNode );
osgViewer::Viewer *wViewer = new osgViewer::Viewer();
wViewer->setUpViewerInWindow( 100, 100, 800, 600 );
wViewer->setSceneData( wRootNode );
wViewer->realize();
osgSim::HeightAboveTerrain wHatTester;
osg::CoordinateSystemNode *wCsn =
dynamic_cast<osg::CoordinateSystemNode*>(wTerrainNode);
wCsn->setEllipsoidModel( new osg::EllipsoidModel() );
We then use the following code to query HAT (in our main loop):
wCsn->getEllipsoidModel()->convertLatLongHeightToXYZ( wLat, wLon,
wHeight, wX, wY, wZ );
// where wLat, wLon, wAlt are dynamic, valid values within the terrain
area being populated by our flight model
double wHat = wHatTester.computeHeightAboveTerrain( wTerrainNode,
osg::Vec3d( wX, wY, wZ ), -1 );
In each case wHat remains a constant value consistent with height above sea
level (i.e., no hits are being generated against the terrain). We are also
visualizing our observer position with the same lat/lon/alt values and observe
a valid, correlated position, so we know that the terrain is loading and that
the lat/lon/values being used for the HAT query are reasonable.
Any thoughts as to why we're not getting any hits?
Thank you,
Murray
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org