|
楼主 |
发表于 2009-12-18 15:41:20
|
显示全部楼层
谢谢啦!用EarthManipulator解决了鼠标和滚轮的问题!
是这样解决的:
std::string modelPath =
"F:\\word_wind.earth";
{
// create an osgEarth node. Add it to the scene graph and let the ref pointer go out of scope.
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(modelPath);
viewer.setSceneData(node.get());
}
manip->getSettings()->bindMouseDoubleClick(
osgEarthUtil::EarthManipulator::ACTION_GOTO,
osgGA::GUIEventAdapter:EFT_MOUSE_BUTTON );
// add our fly-to handler
viewer.addEventHandler(new FlyToViewpointHandler( manip ));
// add some stock OSG handlers:
viewer.addEventHandler(new osgViewer::StatsHandler());
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
继续找海拔数据,有什么可以提供的建议么? |
|