Hi Ricardo,

Why don't try reference time?

viewer.getFrameStamp()->getReferenceTime();

Rafa.


On Mon, Nov 23, 2009 at 1:29 AM, Ricardo Ruiz <[email protected]> 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
> [email protected]
> 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
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to