[osg-users] Get Animation current time

Diego Mancilla dmancillac at gmail.com
Fri Dec 28 06:15:29 PST 2018

Hello Robert,

First of all, thank you for your answer. I'm just starting to use OSG so I'm learning  as I go.

So, my issue is a little more complicated (I think).

I have serveral AnimationPath instances. Each one with a AnimationPathCallback derived class attached to it. So, the thing is that I want to retrieve current animation time to the main application, ideally without having to traverse each animated node.


I have a Qt app with an osg::Viewer embedded (subclassing QOpenGLWidget), so the objective is to handle the "animation timeline" through a QSlider.

1 - Can I, from the osg::FrameStamp instance "reconstruct" the current animation time from the AnimationPath instances or from anywhere else?

2- Besides the "while (!viewer.done())..." loop, is there a way to control the time sampling of the animation? i.e. the times at which the AnimationPath::getInterpolatedControlPoint method is called (from the AnimationPathCallback::update method)?

Thank you again, for your help.


Read this topic online here:

More information about the osg-users mailing list