Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

animation (was Re: VisAD contour surfaces)

> If one is running an animation using an AnimationControl generated
> from a ScalarMap, i.e.
>
>   animap = new ScalarMap(RealType.Time, Display.Animation);
>   display.addMap(animap);
>   anim_controller = (AnimationControl) animap.getControl();
>
> is there any way to determine the index (or the Time value) of the
> image that is currently being displayed?
 
Good point.  I have added the following method to
AnimationControl:
 
  public int getCurrent()
 
It returns the ordinal step number of the current
animation step.  You can get the Time value as
follows:
 
  int current = animation_control.getCurrent();
  float[][] values
    animation_control.getSet().indexToValue(new int[] {current});
  float time_value = values[0][0];
 
Note that AnimationControl.getSet() returns the
(1-D) Set of samples of Time (or whatever RealType
is mapped to Animation) associated with animation
steps.
 
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
whibbard@xxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html
 
"kill cross-platform Java by growing the polluted Java market"
   - from an internal Microsoft planning document
 

  • 1998 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: