Hi,
I'm trying to animate a character with data from a bvh
I have tried a lot of different setups.. but none work. The osgAnimation seems
to have what it needs to get this working, but there isn't enough documentation
to make sense of it.
This is where I am at now:
Code:
osg::Node* createScene()
{
// convenience variables
osg::Node* bvh = osgDB::readNodeFile( osgDB::findDataFile( "test.bvh" )
);
osg::Node* model = osgDB::readNodeFile( osgDB::findDataFile( "test.dae"
) );
osgAnimation::BasicAnimationManager* manager = new
osgAnimation::BasicAnimationManager;
// get animation from bvh
osgAnimation::AnimationManagerBase* animationManager =
dynamic_cast<osgAnimation::AnimationManagerBase*>(bvh->getUpdateCallback());
osgAnimation::Animation* anim = animationManager->getAnimationList()[0];
anim->setPlayMode( osgAnimation::Animation::LOOP );
osg::Group* group = new osg::Group;
group->setUpdateCallback( manager );
group->addChild( model );
manager->registerAnimation(anim);
manager->buildTargetReference();
manager->playAnimation( anim );
return group;
}
The BVH contains Skeleton and Bones
The Model contains Skeleton, Bones, RigGeometry
so,.. what I basically do is create my own BasicAnimationManager extract the
animation from bvh and register it.
I can see the character clearly being render, but with no animation.
Am I missing something?
Thank you!
Cheers,
Peter
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=55853#55853
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org