Re: Problem imaging a matrix

Hi Wallace,

> Thanks for your reply. Your suggestions were very helpful in providing me
> with new avenues along which to search. Unfortunately, after implementing
> your suggestions things still didn't work out as I was expecting.
> Upon performing the steps:
>      GraphicsModeControl dispGMC = (GraphicsModeControl)
> display.getGraphicsModeControl();
>      dispGMC.setScaleEnable(true);
>      dispGMC.setCurvedSize(1); // map texture onto full-res terrain
> I get the same result as before (I get 5 equi-spaced peaks and 4 valleys).
> Changing setCurvedSize to 0 results in 9 equi-spaced peaks and 8 valleys. I
> get the same results when I use the alternative setting:
>      dispGMC.setTextureEnable(false);  // disable texture mapping
>      //dispGMC.setCurvedSize(0); // map texture onto full-res terrain
> I noticed that when I set the 1s along the alternative diagonal, i.e. (1,
> 9), (2, 8), (2, 7), (2, 6), etc), that the display becomes a ridge along
> the diagonal as I expect. This occurs when setCurvedSize is given a setting
> of both 1 and 0.
> It seems as though the 2D interpolation for the display is occurring at
> double the spatial frequency of the domain that the data exists over. It
> also seems as though this interpolation has a presumed angular orientation.
> Can I have any control over these parameters? My domain is defined using:
>      domain_set = new Linear2DSet(domain_tuple, 1.0, (double)NROWS, NROWS,
>                                           1.0, (double)NCOLS, NCOLS);
> Any further suggestions that you may have would be very helpful.

Thank you for digging into this.  I have been out of email
contact since 22 Sept and leave again tommorrow AM for IEEE
Visualization in Salt Lake, and your effort is appreciated
at this slightly hectic time.

I found some dumb code that constrained curvedSize > 1 and
have changed that.  Note however that curvedSize = 0 forces
setTextureEnable(false), so that is what is really working
for you.

The interpolation seems to double the spatial frequency
because it divides every rectangle in a Gridded2DSet
topology into two triangles.  The weird effect you saw is
because it has to choose between two different diagonal
orientations for dividing rectangles into triangles.  When
the diagonals coincide with the large scale ridge in your
diagonal matrix, the image looks good.  When the diagonals
are perpendicular with the large scale ridge, it doesn't
look good.

The diagonal matrix is an extreme example.  If you apply
setTextureEnable(false) to your original data, it may look
the way you'd like it to.

If you want more exlicit control, you can get it by
explicitly constructing the triangle topology you want in
a DelaunayCustom object and passing it with your samples
array to an Irregular2DSet constructor (i.e., use an
Irregular2DSet instead of a Gridded2DSet in your Field).
Note that if your samples basically lie on a rectangular
grid then it won't be too difficult to construct an irregular
topology for them where you explicitly decide which diagnoal
to use for each rectangle.  The most diffiult part will be
deciding where the large-scale ridges lie in the data.

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738