Edge color problem

Hi,

I seem to recall this coming up before but I can't find anything in the archives.

I have a simple FlatField with some values set to NaN. When rendered with texture disabled, the edges of the data depiction (next to the NaN values) don't have the correct color (usually white). See the attached image (tiny snip) and sample code below.

Is this a VisAD bug or a deeper graphics problem? I see it on all platforms (Linux and Windows with jdk1.4+ and Java3D 1.3) I've tested (though the edge is black on some).

Thanks,
Doug

--------------------------------------------------------
import visad.*;
import visad.util.DataUtility;
import java.rmi.RemoteException;
import java.io.IOException;
import java.awt.*;
import javax.swing.*;

public class TestBug {

  public static void main(String args[])
         throws VisADException, RemoteException, IOException {

      RealType range = RealType.getRealType( "foo" );
      RealTupleType domain = RealTupleType.SpatialEarth2DTuple;
      FunctionType ftype = new FunctionType( domain, range );
      int n = 100;
      Set set = new Linear2DSet(domain,1,n,n,1,n,n);

      float[][] samples = new float[1][n*n];
      int ii=0;
      for ( int i=0; i<n; i++ ) {
          for ( int j=0; j<n; j++ ) {
              samples[0][ii]=(float)(Math.sin(3.14*i/n) *
                Math.sin(3.14*j/n));
              if (samples[0][ii] < 0.2) samples[0][ii] = Float.NaN;
              ii++;
          }
      }

      FlatField field = new FlatField( ftype, set );
      field.setSamples( samples );

      DisplayImpl display = DataUtility.makeSimpleDisplay(field);
      display.getGraphicsModeControl().setTextureEnable( false );

      JFrame frame = new JFrame();
      frame.getContentPane().add(display.getComponent());
      frame.setSize(400, 400);
      frame.setVisible(true);
  }
}

--
*----------------------------------------------------------------------*
| Doug Lindholm, Software Engineer          |  E-mail: lind@xxxxxxxx   |
| Research Applications Program             |   Phone: 303-497-8374    |
| National Center for Atmospheric Research  |                          |
| P.O. Box 3000                             |     There's no place     |
| Boulder, Colorado 80307-3000              |        like $HOME        |
*----------------------------------------------------------------------*

GIF image

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