- Forward


Animation in OpenGL
An Introduction


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Definitions
Back SMYC Forward
  • Animate:
    • To give life or motion
  • Animation:
    • A group of techniques that can make visual content appear to move
A Simple Animation Loop
Back SMYC Forward
  1. Transform the content
  2. Render the content "off screen"
  3. Clear the screen
  4. Move the off-screen "image" to the screen
The Content
Back SMYC Forward
openglexamples/basics/animation.c (Fragment: content)
 
Initialization
Back SMYC Forward
openglexamples/basics/animation.c (Fragment: init)
 
Updating the Content
Back SMYC Forward
openglexamples/basics/animation.c (Fragment: update)
 
Rendering/Displaying the Content
Back SMYC Forward
openglexamples/basics/animation.c (Fragment: display)
 
A Common (Bad) Way to Animate
Back SMYC Forward
Animate as Fast as You Can
openglexamples/basics/badanimation.c (Fragment: setupIdle)
 
openglexamples/basics/badanimation.c (Fragment: idle)
 
The Correct Way to Animate
Back SMYC Forward
Use a Timer
openglexamples/basics/animation.c (Fragment: setupTimer)
 
openglexamples/basics/animation.c (Fragment: timer)
 
There's Always More to Learn
Back -