Re: How to draw a line

Combine the x, y and interpolated z values in a
float[3][number_of_points] array and use them to
construct a Gridded3DSet with manifold dimension = 1.
This should display at roughly the level of the
topography surface. You can make it smoother by
interpolating to more (x, y) points and getting
the z values for these from your topography. You
may also add a small constant to the z values to
lift the line above the surface. You can give the
line its own color by a ConstantMap[] array passed
to addReference() with the DataReference to your
line.

Good luck,
Bill

On Mon, 3 Dec 2001, gaoming fu wrote:

>
> Hi, Bill:
>
> Thank you very much for your help. I tried to add some code from
> Rivers.java to my class. It
> did draw one line for me. But it is not really what I want to do. Likely
> I did not specify my
> question clearly.
>
> I draw my original data using Irregular2DSet and got a topography
> surfacce. Now, let me use river as an example to explain what I want to
> do. I want to draw a river on top of my topograpy surface. For the data
> of the river, I have some points with only x and y values. These points
> are not equally spaced or gridded (image real situation of river on the
> earth). I used valueToInterp method of Irregular2DSet to get elevations
> of these points. So now I have x,y and z values of these points. I want
> to draw these points as one line (i.e., like a river) on the top of the
> surface of my original data. I guess, if the interpolation is very good,
> this line will be on the top of the surface of my original data. If the
> interpolation is not good, some segments of this line may be above the
> surface, some segments of this line may be below the surface. I also want
> to draw this line with a meaningful color, e.g., blue. I do not want to
> mix
> its color with the color of the surfa! ce! of my original data (from
> Display.RGB).
>
> Thanks a lot.
>
> Gaoming Fu
>
>
>
> >From: Bill Hibbard
> >To: gaoming fu
> >CC: visad-list@xxxxxxxxxxxxx
> >Subject: Re: How to draw a line
> >Date: Mon, 03 Dec 2001 09:13:03 -0600
> >
> >Hi Gaoming,
> >
> > > I used Irregular2DSet to draw my data. I also used its valueToInterp
> method to
> > > interpolate some points. Now I want to draw these interpolated points
> as one line
> > > instead of surface in the same Coordinate system of my original data.
> >
> >Use the locations of the interpolated points to construct a
> >Gridded2DSet with manifold dimension = 1. You can see an
> >example of this constructor in visad/examples/Rivers.java
> >(which then combines several such Gridded2DSets into a
> >UnionSet to get several lines, but you don't need that step).
> >
> >Good luck,
> >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
>
> ________________________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: