Re: constant animations

New Message Reply Date view Thread view Subject view Author view

B. Alex Kekesi (akekesi++at++vlasov.gsfc.nasa.gov)
Fri, 1 Aug 1997 09:42:03 -0400


Ryan,

I think this is the sort of thing you're looking for...

void
timedAnimation()
{
double starttime;
double endtime = ????; /* Length of time for animation */

starttime = pfGetTime(); /* Gets current time for start */

while((pfGetTime()-starttime) <= endtime)
   Animate_Object(); /* Goes through one cycle of the animation */

}

main()
{
 pfInitClock(0.0);
 timedAnimation();
}

-Hope this helps!

Alex Kekesi email: B.A.Kekesi.1++at++gsfc.nasa.gov
Hughes STX Corp.
NASA Goddard Space Flight Center
Scientific Visualization Studio
Code 935, Bldg. 28, Rm. S121
Greenbelt, MD 20771

> Hi -
>
> I'm working on a problem that I'm confident has a slick solution. (and has
> alredy been solved)
>
> I want to start someting animating and have it run for a specific time. I
> want this time to be constant regardless of how fast the application is
> running.
>
> Should I make this a time based problem using: gettimeofday(), or base the
> animation the frame rate and count ~ pfGetFrameCount()?
>
> Any suggestions?
>
> Thanks
>
> Ryan
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:42 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.