KCEC4302_08_OpenGL_Animation - KCEC4302 Visual & Graphics...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
KCEC4302 – Visual & Graphics Chapter 8: Animation 1 Chapter 8: Animation Module Objectives At the completion of this module, you will be able to Animate objects in the scene Improve performance by turning off animation when it is not visible Use double buffers to make models move smoothly Making Objects Move Drawing only the parts that moved is too hard Redraw the entire scene each frame In order to draw only the parts that moved (in this case the earth and moon), we would first have to draw over their old positions with whatever is supposed to be there in the new frame, and then we would have to draw them in their new positions. It is much simpler to just redraw the entire scene with the earth and moon in their new position. The problem with this is that the eye sees the intermediate clear and incremental drawing. This leads to a flickering effect.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
KCEC4302 – Visual & Graphics Chapter 8: Animation 2 Continuous Animation void glutIdleFunc( void (*func)(void) ) Sets up a function to be called when no window system events are being received o Useful for background task processing or continuous animation func is a pointer to the idle callback o Called by glutMainLoop() o Should be kept short so as not to affect interactive performance o If NULL, generation of the idle callback is disabled /* sample IdleFunc for continuous animation */ void animate( void ) { /* update rotation angle for the planets */ glutPostRedisplay(); } This method of performing continuous animation is similar to the X
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/08/2009 for the course ENGINEERIN kcec4302 taught by Professor Yhj during the Spring '09 term at University of Malaya.

Page1 / 5

KCEC4302_08_OpenGL_Animation - KCEC4302 Visual & Graphics...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online