|
程序:
#include<osgViewer/Viewer>
#include<osg/Node>
#include<osg/Geode>
#include<osg/Group>
#include<osgUtil/Optimizer>
#include<osgDB/ReadFile>
#include<osgDB/WriteFile>
#include<osgGA/AnimationPathManipulator>
int main( )
{
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer();
osg::ref_ptr<osg::Group> root = new osg::Group();
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile("lz.osg");
osg::ref_ptr<osgGA::AnimationPathManipulator> apm = new osgGA::AnimationPathManipulator("saved_animation.path");
viewer->setCameraManipulator(apm.get());
root->addChild(node.get());
osgUtil::Optimizer optimizer;
optimizer.optimize(root.get());
viewer->setSceneData (root.get());
viewer->realize();
viewer->run();
return 0;
}
运行后没图像,只有这个
|
|