Ok, I m studying callback and nodevisitors from the OSG book these days and I have some advance. :)
I have this class : class FindNamedNode : public osg::NodeVisitor { public: FindNamedNode( ) : osg::NodeVisitor( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN ){} virtual void apply( osg::Node &node ) { cout<<"\n"<<node.getName(); traverse( node ); } }; FindNamedNode *fn; fn=new FindNamedNode(); // then I load my object here : osg::Node* testenode; testenode=osgDB::readNodeFile(obj_mesh); testenode->accept(*fn); When I run the programm appears a list of nodes . The node names from visitor that run on my object.This I understood. very good! :) My doubt is, like I got the name of node, how do I get the total frame or time of animationPath . I see in .OSG file the animation path . I changed the loop to NO_LOOPING and the object play onetime. very good too.But I still need to know the animation time and later to check the current time. Why I need this ? I have to load a cellphone that user can interact . then I have the cellphone closed and only when the user click the animation of cellphone openning ll play one time . after the user can close the cellphone . the animation of cellphone closing ll appear and play . this can repeat many times the user wants . for this I have to do something like a review and play to be sure that animation dont break from one animated object to other. I m seeing the examples but look like that dont have how I need. only have animation done in program, not loaded from external file. If you have other way to do this please say me.
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org