// SurfaceAnimation.java import java.awt.event.*; import java.rmi.RemoteException; import javax.swing.JFrame; import visad.*; import visad.java3d.*; /** Constructs a surface whose colors animate over time. */ public class SurfaceAnimation { public static void main(String[] args) throws VisADException, RemoteException { int numTimePoints = 10; int xLen = 32, yLen = 32; int len = xLen * yLen; // construct data types RealType tType = RealType.getRealType("time"); RealType xType = RealType.getRealType("x"); RealType yType = RealType.getRealType("y"); RealType zType = RealType.getRealType("z"); RealType vType = RealType.getRealType("value"); RealTupleType xy = new RealTupleType(xType, yType); RealTupleType zv = new RealTupleType(zType, vType); FunctionType surfaceType = new FunctionType(xy, zv); FunctionType animType = new FunctionType(tType, surfaceType); Integer2DSet surfaceSet = new Integer2DSet(xy, xLen, yLen); Integer1DSet animSet = new Integer1DSet(tType, numTimePoints); // generate surface values float[] surface = new float[len]; for (int y=0; y