Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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
 

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690