Thank Robert. It works. Dat
On Mon, Jan 18, 2010 at 3:53 AM, Robert Osfield <[email protected]> wrote: > Hi Dat, > > If you are finished with the animation then just remove the animation > path callback. > > Robert. > > > On Fri, Jan 15, 2010 at 7:52 PM, Nguyen Tien Dat <[email protected]> wrote: >> Dear all, >> I have a scene structure like this: >> rootNode -> matrixTranformNode -> objectNode >> >> I modify the position and orientation of the object by setting the >> matrix of the matrixTranformNode and it works well. But the problem >> appears when I try to use animation path. I create an animation path >> like this: >> >> osg::AnimationPath* animationPath = new osg::AnimationPath; >> animationPath->setLoopMode(osg::AnimationPath::NO_LOOPING); >> //initialize startPoint, endPoint, rotation >> animationPath->insert(0.0,osg::AnimationPath::ControlPoint(startPoint >> , rotation)); >> animationPath->insert(0.0,osg::AnimationPath::ControlPoint(endPoint >> , rotation)); >> matrixTranformNode->setUpdateCallback(new >> osg::AnimationPathCallback(animationPath)); >> >> The animation looks as expected. But after the animation I try to >> update the matrix of matrixTranformNode, it doesn't work properly. The >> object is still in the place of the last frame of animation, and it >> won't change its position and orientation no matter how I try to >> change the matrix. When I try to call getMatrix method of >> matrixTransformNode, the matrix is changed as I set it. But the object >> isn't displayed correctly. >> Could any of you tell me what happens with the matrixTransformNode >> after the animation? How can I manipulate the object again after the >> animation? >> Note that I did try to replace the matrixTransformNode by a new one >> (so the scene structure is rootNode -> newMatrixTransformNode -> >> objectNode), and then I could manipulate the object again. But this >> doesn't work smoothly when you want to have continuous motion between >> the animation created by AnimationPath and the animation created by >> your manipulation. >> Thanks, >> Dat >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

