Re: constant animations

New Message Reply Date view Thread view Subject view Author view

george williams (gcw++at++best.com)
Fri, 01 Aug 1997 15:25:56 -0700


At 09:42 AM 8/1/97 -0400, you wrote:
>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 */
>

This function must in general be informed of the delta time between the last
and current frame so that the animation between 'start' and 'end' time is
smooth as well.

>}
>
>
>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
>
>

=======================================================================
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.