- Forward


Sprite Animation in OpenGL


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Review
Back SMYC Forward
  • The animation approach we used so far is "ad hoc"
  • This means that we have to write the same code in every application that uses animation
Using Sprites
Back SMYC Forward
  • A Sprite:
    • Visual content that is responsible for its own dynamic behavior
  • A Stage:
    • Forwards timer, mouse, and keyboard events to Sprite objects
Using Sprites (cont.)
Back SMYC Forward

Sprite: The Header

openglexamples/animation/Sprite.h
 
Using Sprites (cont.)
Back SMYC Forward

Sprite: The Implementation

openglexamples/animation/Sprite.cpp
 
Using Sprites (cont.)
Back SMYC Forward

Stage: The Header

openglexamples/animation/Stage.h
 
Using Sprites (cont.)
Back SMYC Forward

Stage: The Implementation

openglexamples/animation/Stage.cpp
 
An Example - Spinning Cubes
Back SMYC Forward

Cube: The Header

openglexamples/animation/Cube.h
 
An Example - Spinning Cubes
Back SMYC Forward

Cube: The Implementation

openglexamples/animation/Cube.cpp
 
Spinning Cubes (cont.)
Back SMYC Forward

The Driver

openglexamples/animation/Driver.cpp
 
An Example - The Solar System
Back SMYC Forward

Sun: The Header

openglexamples/animation/Sun.h
 
An Example - The Solar System
Back SMYC Forward

Sun: The Implementation

openglexamples/animation/Sun.cpp
 
The Solar System (cont.)
Back SMYC Forward

Earth: The Header

openglexamples/animation/Earth.h
 
The Solar System (cont.)
Back SMYC Forward

Earth: The Implementation

openglexamples/animation/Earth.cpp
 
The Solar System (cont.)
Back SMYC Forward

Moon: The Header

openglexamples/animation/Moon.h
 
The Solar System (cont.)
Back SMYC Forward

Moon: The Implementation

openglexamples/animation/Moon.cpp
 
The Solar System (cont.)
Back SMYC Forward

The Driver

openglexamples/animation/SolarSystem.cpp
 
There's Always More to Learn
Back -