[osg-users] How can I get last frame time inn order to create indepent FPS aniamtions?

Ricardo Ruiz osgforum at tevs.eu
Mon Nov 23 06:58:29 PST 2009

Thanks Rafa, but it does not work.


	double angle=0;
	float delta=1;
	while (!viewer.done()) {
		float start=viewer.getFrameStamp()->getReferenceTime();
		viewer.getCamera()->setViewMatrixAsLookAt(osg::Vec3(0,-400,150), osg::Vec3(0,0,0), osg::Vec3(0,0,1));
		float delta=viewer.getFrameStamp()->getReferenceTime()-start;		
	return 0;

Animation is smooth, (I have a ATI 3870 and quadcore) but faster in release than debug (I mean animation, not FPS).
I has no sense. Maybe release version uses some threads that debug not.

Is this the correct way to implement independent animation time?

By the way Rafa, I'm also studing at UPV, a master in software engineering.


Read this topic online here:

More information about the osg-users mailing list