Re: how to fill in pixels

On Tue, 20 Aug 2002, V. Lakshmanan wrote:

> I have just started using VisAD and after coding
> up my first application, have run into two problems.
>
> 1) The image shows up as a set of thin lines, i.e. the pixels
> are not filled in.  Perhaps I am using the wrong rendering
> or data type ... ?
>   My math type is:
>      (radial, gate) --> (x,y,z, value)
>  and I am displaying using the java 3D display
>  with x as Display.XAxis, etc. and value as Display.RGBA

I assume that your (radial, gate) are polar coordinates.
Rather than ScalarMaps x -> XAxis and y -> YAxis, try
ScalarMaps of radial and gate to Radius and Longitude,
which are VisAD display polar coordinates (which along
with Latitude form display spherical coordinates for
3-D displays).

Filled displays require a topology for interpolating
between points, and that topology needs to come from
the domain Set of a Field. Hence filled displays need
ScalarMaps from domain RealTypes of a Field.

>  I also tried using the FlowSpherical coordinate transform
>  instead of explicitly providing x,y,z but I get the same result.
>  I would like a textured image ... (I did the setTextureEnable
>  without any effect).
>
> 2) I saw on the list that Don Murray suggested using a set of numbers
> and explicitly assigning colors to get discrete colors for a
> continuous field.  The problem is that my data are floating point
> values, and so I can not really come up with exact
> numbers for a color table.
> So, I used a FlatField and the setFunction method.
> How do I tell the FlatField that the data should be
> NEAREST_NEIGHBOR and not WEIGHTED_AVERAGE?

I recommend using setTable() rather than setFunction(),
which is rarely used and possibly buggy. You can define
whatever length of table you like, and they are an evenly
spaced sampling of the range of values in your ScalarMap
to RGB (you can control that range via the setRange()
method of the ScalarMap).

Good luck,
Bill