Download presentation
Presentation is loading. Please wait.
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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.