/*
A simple demonstration of VisAD's volume rendering capabilities.
*/
import java.rmi.RemoteException;
import javax.swing.*;
import visad.*;
import visad.java3d.DisplayImplJ3D;
public class visad_3D_render {
public static void main(String[] args)
throws VisADException, RemoteException
{
// create types
RealType x = RealType.getRealType("x");
RealType y = RealType.getRealType("y");
RealType z = RealType.getRealType("z");
RealTupleType xyz = new RealTupleType(x, y, z);
RealType value = RealType.getRealType("value");
// generate some regular samples
int size = 32;
int count = size * size * size;
Linear3DSet set = new Linear3DSet(xyz,
0, 1000, size, 0, 1000, size, 0, 1000, size);
float[][] samples = set.getSamples(false);
// build field
FunctionType ftype = new FunctionType(xyz, value);
FlatField field = new FlatField(ftype, set);
float[][] values = new float[1][count];
for (int i=0; i