Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

Re: surface transparency

Hi Gaoming,

> I used Gridded2DSet to draw a topography surface. I also want to draw some 
> street lines on the surface. Each street line has some points with
> only x and y, I used valueToInterp method to interpolate these points to get 
> z values, then draw these points as one line. My problem is, some
> segment of the line are below the surface. So I want my topography surface to 
> be transparent so that every thing below the surface can be seen
> clearly. I tried the following:
> 
> dispGMC = (GraphicsModeControl)display.getGraphicsModeControl();
> dispGMC.setTransparencyMode(javax.media.j3d.TransparencyAttributes.SCREEN_DOOR);

The last time I tired screen door, it didn't work. I'd delete
these statements.

> zMap   = new ScalarMap(Z, Display.RGB);
> display.addMap(zMap);
> display.addMap(new ScalarMap(Z, Display.Alpha));

Instead of mapping Z -> Alpha, try a ConstantMap to Alpha.
Or replace the ScalarMap of Z -> RGB with Z -> RGBA, then
set alpha values in the table of the ColorControl.

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


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