Hi Desiree,
> Hi thanks for your help, VisAd is working now, and I tried to implement
> your hints.
> So after the Triangulation I get an object terrain (class FlatField), how
> does the geometry of this object looks like?
> For implementing some Java3D-Objects for my application, I guess I need
> some information about triangles, so that I know these coordinates go
> together to build a triangle for building a 3D-object.
> Sorry I am not experienced with Triangulations, am I wrong?
> How would I got to build my 3D-obejcts?
> . . .
> > Assume that the locations of your points are defined in two
> > arrays:
> >
> > float[] x_locations, y_locations;
> >
> > and the terrain heights at these points are defined in the
> > array:
> >
> > float[] heights;
> >
> > Then you can create a terrain as a FlatField like this:
> >
> > RealType x = RealType.getRealType("x");
> > RealType y = RealType.getRealType("y");
> > RealType height = RealType.getRealType("height");
> > RealTupleType xy = new RealTupleType(x, y);
> > FunctionType terrain_type = new FunctionType(xy, height);
> >
> > Irregular2DSet set
> > new Irregular2DSet(xy, new float[][] {x_locations, y_locations});
> > FlatField terrain = new FlatField(terrain_type, set);
> > terrain.setSamples(new float[][] {heights});
To display your terrain, you construct a display, add some
ScalarMaps, add the terrain, and add your display to a GUI:
DisplayImplJ3D display = new DisplayImplJ3D("name");
display.addMap(new ScalarMap(x, Display.XAxis));
display.addMap(new ScalarMap(y, Display.YAxis));
display.addMap(new ScalarMap(height, Display.ZAxis));
DataReferenceImpl terrain_ref = new DataReferenceImpl("terrain");
terrain_ref.setData(terrain);
display.addReference(terrain_ref);
JFrame frame = ...
. . .
frame.getContentPane().add(display.getComponent());
. . .
You don't need to worry about constructing a 3-D object.
That is a service provided by VisAD.
Please study the tutorials and examples.
Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706
hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html