[osg-users] How can I get last frame time inn order to create indepent FPS aniamtions?
Ricardo Ruiz
osgforum at tevs.eu
Sun Nov 22 16:29:28 PST 2009
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
More information about the osg-users
mailing list