[osg-users] How can I get last frame time inn order to create indepent FPS aniamtions?
Rafa Gaitan
rafa.gaitan at gmail.com
Sun Nov 22 22:42:56 PST 2009
Hi Ricardo,
Why don't try reference time?
viewer.getFrameStamp()->getReferenceTime();
Rafa.
On Mon, Nov 23, 2009 at 1:29 AM, Ricardo Ruiz <osgforum at tevs.eu> wrote:
> Hi all.
>
> How can I get last frame time inn order to create indepent FPS aniamtions?
>
> For instance, something like m_last_time_frame:
>
>
>
> Code:
>
> double angle=0;
> while (!viewer.done()) {
> angle=angle+0.1*m_last_time_frame;
> viewer.getCamera()->setViewMatrixAsLookAt(osg::Vec3(0,-400,150), osg::Vec3(0,0,0), osg::Vec3(0,0,1));
> viewer.getCamera()->setViewMatrix(osg::Matrix::rotate(angle*DEG_TO_RAD,0,0,1)*viewer.getCamera()->getViewMatrix());
> viewer.frame();
> }
>
>
>
>
> Thanks.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=20102#20102
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
More information about the osg-users
mailing list