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

Reply via email to