"Rakesh Parmar" writes:

> Hi,
>
> i am trying to do animation about own axis of object
> itself but i am not getting correctly. 
>
>
> Code:
>
>
> virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
>   { 
>       if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
>       {
>               osg::MatrixTransform* MT = 
> dynamic_cast<osg::MatrixTransform*>(node);
>               if (MT) {
>                                       osg::Vec3 result(0,1,0);
>                                       osg::Matrix Rot;
>                                       Rot.makeRotate(1,result);
>                                       MT->setMatrix(Rot*MT->getMatrix());
>               }
>       }
>       ///traverse(node,nv);
>   }
> ]

Hi Rakesh,

at a glance I can't see anything wrong. What is happening when you run
your program that is different that you were expecting? Can you test
that the update callback is in fact being visited printing a message or
with the debugger?

-- 
Alberto

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to