osg help

#ifdef _WIN32
#include <Windows.h>
#endif // _WIN32

#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
#include <osgGA/GUIEventAdapter>
#include <osgViewer/ViewerEventHandlers>

int main()
{
  osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
  osg::ref_ptr<osg::Node> node = new osg::Node;

  node = osgDB::readNodeFile("D:\\参考手册\\BIM\\osg\\library.OSGB");
  viewer->setSceneData(node.get());
  viewer->setUpViewInWindow(200,200,700,500,0);
  
  //添加帮助事件
  viewer->addEventHandler(new osgViewer::HelpHandler);

  return viewer->run();
}

 

posted @ 2019-06-14 20:41  西北逍遥  阅读(216)  评论(0编辑  收藏  举报