Hi,

i want to move a MatrixTransform (mt) with animation.
I dont want to generate an new pat or something like this under the mt.
When i directly animate the mt with

Code:

osg::Vec3d startAnimationVec = mt->getBound().center();
osg::Vec3d endAnimationVec = startAnimationVec + osg::Vec3f(0.0f,2.0f,5.0f);
osg::ref_ptr<osg::AnimationPath> animationPath = new osg::AnimationPath();

animationPath->setLoopMode(osg::AnimationPath::NO_LOOPING);
animationPath->insert(0, startAnimationVec);
animationPath->insert(1, endAnimationVec);

osg::ref_ptr<osg::AnimationPathCallback> animationPathCB = new 
osg::AnimationPathCallback(animationPath.get(), 0.0, 2.0);
animationPathCB->setAnimationPath(animationPath.get());
mt->setUpdateCallback(animationPathCB.get());




the movement is correct but the the other values in the mt are erased.
So before the animation the Matrixd of the mt look like 

Code:
(a,b,c,x,
d,e,f,y,
g,h,i,z)


and afterwards 

Code:
(1,0,0,x,
0,1,0,y,
0,0,1,z)



How can i animate without losing the matrix?
Thank you!

Cheers,
Andrew

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=35507#35507





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to