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.1f,1.1f),12.0f,1000.0f,0.8,1e-8,true,2.5f,10.0f,256);
//
osg::ref_ptr<osgOcean::OceanScene>oceanScene=new osgOcean::OceanScene(oceanSurface.get());//(oceanSurface.get());
viewer->addEventHandler(oceanSurface->getEventHandler());
//
viewer->addEventHandler(oceanScene->getEventHandler());
osgGA::TrackballManipulator* tb =new osgGA::TrackballManipulator;
tb->setHomePosition(osg::Vec3f(0.0f,0.0f,20.0f),osg::Vec3f(0.0f,20.0f,20.0f),osg::Vec3f(0.0f,0.0f,1.0f));
viewer->setCameraManipulator(tb);
//
viewer->setSceneData(oceanSurface);
return viewer->run();
}