NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

3D Clouds

Hello again,

I'd hate for traffic on this list to lag, so I'll pose a question. :-)

I have a 3D field related to cloudiness (e.g. 0=clear, 1=cloudy). I'd
like to map this to Display.Alpha to get a cool foggy effect. I managed
to do it for a single layer of clouds (with an Integer2DSet, nothing
mapped to ZAxis) but I am not having much luck getting a 3D
representation. The following gives me my 27 data values as *points*
with brightness proportional to cloudiness. (Mapping to Alpha gives me
nothing.) How can I make my scene cloudy?

Thanks,
Doug

    RealType lat = new RealType("lat",null,null);
    RealType lon = new RealType("lon",null,null);
    RealType alt = new RealType("alt",null,null);
    RealType[] coords = {lat,lon,alt};
    RealTupleType domain = new RealTupleType(coords);
    RealType cloud_type = new RealType("cloudy",null,null);
    FunctionType cloud_ftype = new FunctionType(domain,cloud_type);
    Set grid_set = new Integer3DSet(3,3,3);
    FlatField cloud = new FlatField(cloud_ftype,grid_set);
    float[][] data = {{0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,
                       0.5f,0.3f,0.2f,0.3f,0.2f,0.1f,0.2f,0.1f,0.0f,
                      
1.0f,0.75f,0.5f,0.75f,0.5f,0.25f,0.5f,0.25f,0.0f}};
    cloud.setSamples(data);

    ScalarMap sm_lat = new ScalarMap(lat, Display.XAxis);
    display.addMap(sm_lat);
    ScalarMap sm_lon = new ScalarMap(lon, Display.YAxis);
    display.addMap(sm_lon);
    ScalarMap sm_alt = new ScalarMap(alt, Display.ZAxis);
    display.addMap(sm_alt);
    display.addMap(new ScalarMap(cloud_type, Display.RGB));
    //display.addMap(new ScalarMap(cloud_type, Display.Alpha));

-- 
*----------------------------------------------------------------------*
| 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        |
*----------------------------------------------------------------------*

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