|
我在编译OCEAN 成功,运行例子时出现问题
我新建一个工程 代码如下:
int main ()
{
osg::ref_ptr<osgViewer::Viewer> viewer =new osgViewer::Viewer;
viewer->setUpViewInWindow(150,150,1024,768,0);
//viewer->setSceneData (osgDB::readNodeFile("glider.osg"));
//添加海洋
osg::ref_ptr<osgOcean::FFTOceanSurface> oceanSurface=new osgOcean::FFTOceanSurface(64,256,17,osg::Vec2f (1.1f,1.1f),12.0f,1000.0f,0.8,1e-8,true,2.5,10.0f,256);
//osg::ref_ptr <osgOcean::OceanScene > oceanScene=new osgOcean::OceanScene(oceanSurface.get ());
//这句代码是关键,一打开,就和上面例子的运行效果一样,如果关闭这句代码,在RELEASE下运行可以运行,但效果很难看,效果图附后。
viewer->addEventHandler (oceanSurface->getEventHandler());
viewer->addEventHandler (oceanSurface->getEventHandler());
viewer->setSceneData (oceanSurface);
viewer->run();
return 0;
}
|
|