- Forward


Scientific Animation
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:
    • Techniques that can make a visualization appear to move
Common Types of Scientific Animation
Back SMYC Forward
  • Movies/Videos:
    • Each frame is "pre-generated" (i.e., not in real time)
    • The frames are "played back" in real time
  • Real-Time Animation:
    • Each frame is generated in real time
Common Types of Scientific Animation (cont.)
Back SMYC Forward
  • Our Concern:
    • The generation of the frames
  • Of Less Importance:
    • Whether the frames can be generated in real time
  • Why?
    • Unless we are worried about interactivity, it doesn't matter much whether the frames can be generated in real-time
An Easy Approach
Back SMYC Forward
  • The Process:
    • Have a timer/metronome that "ticks" at a given rate
    • At each "tick", change the visualization a small amount
  • A Physical Analogue:
    • A flip book
Example: A Spinning Globe
Back SMYC Forward
  • Our Objective:
    • Have the globe appear to spin on its axis
  • Our Approach:
    • At each "tick", perform a rotation around the y-axis
Example: A Spinning Globe (cont.)
Back SMYC Forward
Handling "Ticks"
svaexamples/cartography/globe-rotating.c (Fragment: onTimer)
 
Example: A Spinning Globe (cont.)
Back SMYC Forward
Rendering Each Frame is Done as in our Earlier Visualization
svaexamples/cartography/globe-rotating.c (Fragment: onDisplay)
 
Example: A Spinning Globe (cont.)
Back SMYC Forward
Starting and Stopping the Animation
svaexamples/cartography/globe-rotating.c (Fragment: onMouseClick)
 
Example: A Globe that Unfolds
Back SMYC Forward
  • Our Objective:
    • Have a globe that appears to "unfold" itself into a map
  • Our Approach:
    • Calculate the coordinates for the globe and the map
    • At each "tick", change the interpolation fraction
    • When rendering, interpolate between the two types of coordinates
Example: A Globe that Unfolds (cont.)
Back SMYC Forward
Handling "Ticks"
svaexamples/cartography/globe-unfolding.c (Fragment: onTimer)
 
Example: A Globe that Unfolds (cont.)
Back SMYC Forward
Rendering Each Frame
svaexamples/cartography/globe-unfolding.c (Fragment: onDisplay)
 
Example: A Crawling Inchworm
Back SMYC Forward
  • Our Objective:
    • Have an (admittedly simple) inchworm appears to move to the right
  • Our Approach:
    • Use a parametric curve for the inchworm
    • At each "tick", change some of the points describing the curve
      • When the back is moving, move the left end-point (and the control points to make it bend)
      • When the front is moving, move the right end-point (and the control points to make it unbend)
Example: A Crawling Inchworm (cont.)
Back SMYC Forward
Describing the Curve
svaexamples/curves/inchy.c (Fragment: data)
 
Example: A Crawling Inchworm (cont.)
Back SMYC Forward
Rendering the Curve
svaexamples/curves/inchy.c (Fragment: onDisplay)
 
Example: A Crawling Inchworm (cont.)
Back SMYC Forward
Handling "Ticks"
svaexamples/curves/inchy.c (Fragment: onTimer)
 
There's Always More to Learn
Back -