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.

about transparency

Hi there
I am using RGBA in volume rendering(dataset 109*256*256). My expected
effect is to let pixels where data value equals 0 to be complete transparent.
However, the result looks like a cube filled with black ink.
Could you please tell me what's wrong with my code? Thanks a lot.

    int tableLength = 10;
    float[][] myColorTable = new float[4][tableLength];
    for(int i=0;i<tableLength;i++){
      myColorTable[0][i]=(float)(float)i/((float)tableLength-1.0f);//red
      myColorTable[1][i]=(float)(float)i/((float)tableLength-1.0f);//green
      myColorTable[2][i]=(float)(float)i/((float)tableLength-1.0f);//blue
      myColorTable[3][i]=(float)(float)i/((float)tableLength-1.0f);//alpha
    }

    // Force top of table to be white
    myColorTable[0][9]=1.0f;
    myColorTable[1][9]=1.0f;
    myColorTable[2][9]=1.0f;
    myColorTable[3][9]=1.0f;

    // Get the ColorControl from the altitude RGB map
    ColorAlphaControl colCont = (ColorAlphaControl)
    valueRGBMap.getControl();
    // Set the table
    colCont.setTable(myColorTable );



- Zhaopeng :-)


  -_____   ^   _____-
     -__\ [|] /__-
        -_\|/_-
          /M\



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