B. Alex Kekesi (akekesi++at++vlasov.gsfc.nasa.gov)
Fri, 1 Aug 1997 09:42:03 -0400
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
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:42 PDT