Presentation is loading. Please wait.

Presentation is loading. Please wait.

FPS & Time-based Animation

Similar presentations


Presentation on theme: "FPS & Time-based Animation"— Presentation transcript:

1 FPS & Time-based Animation
Reference Fall 2013 revised

2 Frame Rate (畫面更新率) FPS frames per second: many how frames got displayed in a second 1/(time required for single-frame display) For a sufficiently smooth animation, fps > 20 To measure the time a display routine takes Use QueryPerformanceCounter (next pages) To periodically display FPS, use glutTimerFunc() Fall 2013 revised

3 Time a function For low-precision timing,
int glutGet (GLUT_ELAPSED_TIME) is sufficieint [in msec] Fall 2013 revised

4 Example Fall 2013 revised

5 Frame-based vs. Time-based
Use these updates per frame: Simple, but runs differently on different machines Time-based animation Specify linear (or angular) velocity Motion is the same on every machine Important for animations, games, … Fall 2013 revised

6 Time-based Animation Assume the angular velocity of the object is 1RPM (round-per-minute) … like the “second” hand (秒針) Make sure the object rotates in the same speed on different machines Angular displacement between frames Elapsed time between display Fall 2013 revised


Download ppt "FPS & Time-based Animation"

Similar presentations


Ads by Google