Re: Tutorial example: 2-D array pixel position

m huang wrote:
> 
> In the tutorial "3.1 Handling a 2-D array of data: using an
> Integer2DSet", why are the colored squres (pixels) in the 2D
> plot in tutorial.s3.P3_01 not alined with the grid? I mean,
> for example the box whose index is (row=2, col=3) neither
> have its center nor have its corner at coordinate point (2,3).
> I see that if using Continuous 2-D domain values the boxes
> are alined as I expected, but why not integer2Dset ?

This occurs with texture mapping (showing discrete pixels)
but no without tewxture mapping (interpolated colors).

An Integer1DSet(N) gives values 0, 1, ..., N-1 so 0 will
be auto-scaled to one box edge and N-1 will be auto-scaled
to the other box edge. It would look funny (and folks would
complain) if the pixels didn't line up perfectly with the
box edges, so we fit all N pixel squares between the two
edges. But that means that N pixels are fitting into a
data range of (N-1) - 0 = N-1. That's why the pixel boundaries
don't fall exactly on integers. For large images (i.e., large
N) the effect is very small.

> by the way, I am using Java SDK1.3.1 on Windows2000 and when I
> press on the middle mouse button on the plot, the cross and
> coordinate numbers show but they never change no matter where
> I drag the mouse or click the middle buton.
> Any idea as how I get this problem fixed?

We see this sometimes under Windows, the center mouse
button is somehow not being properly reported under JDK. 
You can press the right and left buttons together to
simulate the center button, in VisAD.

Cheers,
Bill


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