Hi Steven,
Would you send all of the sample points, maybe in an attatchment?
Tom Rink
"Steven W. Rock" wrote:
>
> Ok, I'm about 95% of the way there. I set up everything as you outlined,
> and I get the 3-D fault sheet to show up in a display. However it is not
> displayed properly. It is not drawing a "wrinkled sheet of paper flat
> surface".
>
> I can't quite tell what it is doing but it looks like it is drawing a
> continuous line from the first point, along the surface trace, then
> draws a line down to the next surface, which is then traced, down to the
> next surface and so on. It is filling in the outline of each trace
> individually. It almost looks like each level is drawn indivually then
> all traces stacked on top of each other, each level connected by a thin
> line crisscrossing from the last point of the upper level to the first
> point of the next lower level.
>
> Is there a problem with the shape of my data? How can I make this look
> like a smooth flat sheet with only one surface, instead of a flatted
> wire folded into an accordion shape. Thanks for all your help in this
> matter.
>
> Cheers,
> Steve
>
> -------------------------
> Here's my data structure:
> -------------------------
>
> static float[][] loc_vals = new float[][]{
> {34.1231F, 34.12223841F, .... latitude_1102},
> {-117.73972F, -117.7505419F, .... longitude_1102},
> {3.535533906F, 4.242640687F, .... depth_1102}
> }
>
> The 19 X 58 grid is flatted out. At the surface and at each level there
> are 19 lat,lon points along the trace. There are 58 levels going from
> the surface down to about 12 km.
>
> My flattened data has the surface trace 19 points first, then the second
> level, etc.
>
> ---------------
> Here's my code:
> ---------------
>
> latitude = new RealType("latitude",SI.meter,null);
> longitude = new RealType("longitude",SI.meter,null);
> altitude = new RealType("depth",SI.meter,null);
>
> RealType[] vis_array = {latitude, longitude, altitude};
> RealTupleType vis_tuple = new RealTupleType(vis_array);
>
> int NCOLS = 58;
> int NROWS = 19;
>
> domain_set = new visad.Gridded3DSet(vis_tuple, loc_vals, NROWS, NCOLS);
>
> // Make disply, get graphics mode control and draw scales
> display = new DisplayImplJ3D("display1");
> GraphicsModeControl dispGMC = (GraphicsModeControl)
> display.getGraphicsModeControl();
> dispGMC.setScaleEnable(true);
> dispGMC.setTextureEnable(true);
>
> // Create the ScalarMaps:
> latMap = new ScalarMap( latitude, Display.YAxis );
> lonMap = new ScalarMap( longitude, Display.XAxis );
> altZMap = new ScalarMap( altitude, Display.ZAxis );
> altRGBMap = new ScalarMap( altitude, Display.RGB );
>
> // Create a data reference and set the domain set as our data
> data_ref = new DataReferenceImpl("data_ref");
> data_ref.setData( domain_set );
>
> // Add maps and references to display
> display.addMap( latMap );
> display.addMap( lonMap );
> display.addMap( altZMap );
> display.addMap( altRGBMap );
> display.addReference( data_ref );
>
> // Create application window and add display to window
> JFrame jframe = new JFrame("Fault Trace 3D");
> Component comp = display.getComponent();
> jframe.getContentPane().add(comp);
> jframe.setSize(400, 400);
> jframe.setVisible(true);
>
> -----Original Message-----
> From: Bill Hibbard [mailto:billh@xxxxxxxxxxxxx]
> Sent: Thursday, May 09, 2002 11:36 AM
> To: Steven W. Rock
> Cc: visad-list@xxxxxxxxxxxxx
> Subject: RE: Plot Earthquake Fault Trace into the earth
>
> Hi Steven,
>
> > Thanks for all your help. I'm getting closer, but am not there yet.
> What
> > do I use for the FunctionType, FlatField and setting the samples.
> > Finally what do I use for the DataReferenceImpl and use to set it's
> > data. When I try to use the altitude again the graph put's up a
> warning
> > message that altitude is added twice to the graph.
>
> Since all the information is in the Gridded3DSet, you don't need
> a FlatField. Construct a DataReferenceImpl, pass your Gridded3DSet
> to its setData() method, and pass the DataReferenceImpl to the
> addReference() method of your display. You'd only need a Field if
> you had other information dependent on lat, lon and alt, such as
> temperature.
>
> Good luck,
> Bill
>
> > Here's what I have so far ...
> >
> >
> > latitude = new RealType("latitude",SI.meter,null);
> > longitude = new RealType("longitude",SI.meter,null);
> > altitude = new RealType("depth",SI.meter,null);
> >
> > RealType[] vis_array = {latitude, longitude, altitude};
> > RealTupleType vis_tuple = new RealTupleType(vis_array);
> >
> > domain_set = new visad.Gridded3DSet(vis_tuple, loc_vals, 19, 58);
> >
> >
> >
> > display = new DisplayImplJ3D("display1");
> >
> > // Get display's graphics mode control and draw scales
> > GraphicsModeControl dispGMC = (GraphicsModeControl)
> > display.getGraphicsModeControl();
> > dispGMC.setScaleEnable(true);
> > dispGMC.setTextureEnable(false);
> >
> >
> > // Create the ScalarMaps: latitude to YAxis, longitude to XAxis and
> > // altitude to ZAxis and temperature to RGB
> > // Use ScalarMap(ScalarType scalar, DisplayRealType display_scalar)
> >
> > latMap = new ScalarMap( latitude, Display.YAxis );
> > lonMap = new ScalarMap( longitude, Display.XAxis );
> > altZMap = new ScalarMap( altitude, Display.ZAxis );
> >
> > // Add maps to display
> > display.addMap( latMap );
> > display.addMap( lonMap );
> > display.addMap( altZMap );