|
这是编写的代码:
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
#include <osgGA/TrackballManipulator>
#include <osgOcean/Oceanscene>
#include <osgOcean/FFTOceanSurface>
int main()
{
osg::ref_ptr<osgViewer::Viewer>viewer =new osgViewer::Viewer;
viewer->setUpViewInWindow(150,150,1024,768,0);
osg::ref_ptr<osgOcean::FFTOceanSurface>oceansurface=new osgOcean::FFTOceanSurface(64,256,17,osg::Vec2f(1.1,1.1),12,1000,0.8,1e-8,true,2.5,10,256);
osg::ref_ptr<osgOcean::OceanScene>oceanscene=new osgOcean::OceanScene(oceansurface.get());
viewer->addEventHandler(oceansurface->getEventHandler());
viewer->addEventHandler(oceanscene->getEventHandler());
osgGA::TrackballManipulator* tb=new osgGA::TrackballManipulator;
tb->setHomePosition(osg::Vec3(0,0,20),osg::Vec3(0,20,20),osg::Vec3(0,0,1));
viewer->setCameraManipulator(tb);
viewer->setSceneData(oceanscene);
viewer->run();
return 0;
}
出来的结果出问题了
|
|