NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Hi Desiree, > I did manage to include the with VisAD created Delaunay Shape3D Object in > my application. Great. > /** > * Triangulation of given set of points with delaunay. This method > * throws an event, when 3D-Objects are ready. See displayChanged. > */ > public void makeSurface() { > //System.out.println("Hallo Delaunay!"); > RealType x = RealType.getRealType("x"); > RealType y = RealType.getRealType("y"); > RealType height = RealType.getRealType("height"); > try { > RealTupleType xy = new RealTupleType(x, y); > FunctionType terrain_type = new FunctionType(xy, height); > Irregular2DSet set = new Irregular2DSet(xy,new float[][] > {eastValues,northValues}); > FlatField terrain = new FlatField(terrain_type, set); > terrain.setSamples(new float[][] {heightValues}); > > display = new DisplayImplJ3D("display1"); > ScalarMap hoxmap = new ScalarMap(x, Display.XAxis); > ScalarMap reymap = new ScalarMap(y, Display.YAxis); > ScalarMap heightmap = new ScalarMap(height, Display.ZAxis); > > display.addMap(hoxmap); > display.addMap(reymap); > display.addMap(heightmap); > > hoxmap.setRange(-1.0, 1.0); > reymap.setRange(-1.0, 1.0); > heightmap.setRange(-1.0, 1.0); > > DataReferenceImpl data_ref = new > DataReferenceImpl("data_ref"); > data_ref.setData( terrain ); > renderer = new DefaultRendererJ3D(); > display.addReferences(renderer,data_ref); > display.addDisplayListener(listener); > } > catch (VisADException ve) { > System.out.println("VisAd TupleType Exception"); > } > catch (RemoteException re) { > System.out.println("RemoteExcpetion"); > } > //System.out.println("Delaunay ende!"); > } > > Is it possible with visad to get a shap3d of a part of this triangulation? > Say, I do have coordinates of a point and want to clip the parts of the > object, which are more far away, than 10m, or something similar? Yes, if you want to clip in x, y and/or height. Just add ScalarMaps from any of them to Display.SelectRange, then do something like: RangeControl control = (RangeControl) range_map.getControl(); control.setRange(low, hi); // set low and hi clip values Note this is different from ScalarMap.setRange(). It should give you the part of the irregular syrface within the clip range(s). 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
visad
archives: