Scientific Animation
An Introduction
|
Prof. David Bernstein
James Madison University
|
|
Computer Science Department
|
bernstdh@jmu.edu
|
Definitions
- Animate:
- Animation:
- Techniques that can make a visualization
appear to move
Common Types of Scientific Animation
- 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.)
- 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
- The Process:
- Have a timer/metronome that "ticks" at a given rate
- At each "tick", change the visualization a small amount
- A Physical Analogue:
Example: A Spinning Globe
- 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.)
Handling "Ticks"
svaexamples/cartography/globe-rotating.c
(Fragment: onTimer)
Example: A Spinning Globe (cont.)
Rendering Each Frame is Done as in our Earlier Visualization
svaexamples/cartography/globe-rotating.c
(Fragment: onDisplay)
Example: A Spinning Globe (cont.)
Starting and Stopping the Animation
svaexamples/cartography/globe-rotating.c
(Fragment: onMouseClick)
Example: A Globe that Unfolds
- 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.)
Handling "Ticks"
svaexamples/cartography/globe-unfolding.c
(Fragment: onTimer)
Example: A Globe that Unfolds (cont.)
Rendering Each Frame
svaexamples/cartography/globe-unfolding.c
(Fragment: onDisplay)
Example: A Crawling Inchworm
- 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.)
Describing the Curve
svaexamples/curves/inchy.c
(Fragment: data)
Example: A Crawling Inchworm (cont.)
Rendering the Curve
svaexamples/curves/inchy.c
(Fragment: onDisplay)
Example: A Crawling Inchworm (cont.)
Handling "Ticks"
svaexamples/curves/inchy.c
(Fragment: onTimer)
There's Always More to Learn