|
楼主 |
发表于 2010-5-13 17:01:08
|
显示全部楼层
本帖最后由 amen.w 于 2010-5-13 17:07 编辑
一下是我写的代码:请问哪里有问题?
int main( int argc, char **argv )
{
osgViewer::Viewer viewer;
osg::ref_ptr<osgAnimation::Skeleton> skelroot = new osgAnimation::Skeleton;
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile("PickUpBox.bvh");
skelroot->setDefaultUpdateCallback();
skelroot->addChild(node.get());
osg::ref_ptr<osgAnimation::Animation> anim = new osgAnimation::Animation;
anim->setPlaymode(osgAnimation::Animation::PPONG);
osg::ref_ptr<osgAnimation::BasicAnimationManager> manager = new osgAnimation::BasicAnimationManager;
manager->registerAnimation(anim.get());
manager->playAnimation(anim.get());
osg::ref_ptr<osg::Group> root = new osg::Group;
root->addChild(skelroot.get());
root->setUpdateCallback(manager.get());
viewer.setSceneData( root.get() );
return viewer.run();
} |
|