Re: [osg-users] How to compute speed?

2009-09-09 Thread Cedric Pinson
Hi Shiina, A way to do it could to add an update callback that get the world transform on the object each frame, then for the time you have the framstamp, or can get the time with osg::Timer::instance()-time_s() you can store position and time at previous frame, and do your computation like that:

Re: [osg-users] How to compute speed?

2009-09-09 Thread Shiina Ringo
Hi,Cedric Your advice really helped me! Thank you for the fantastic advice! Cheers, Shiina -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17204#17204 ___ osg-users mailing list

[osg-users] How to compute speed?

2009-09-08 Thread Shiina Ringo
Hi, Now just a question have troubled me: is that, an object is moving, using the osgAnimation library, here I want to compute the speed of that object's movement, and if using the V=S/t to compute the speed, then I donot kown how to get the DistanceS, even the Timet. Anyone could give me a