Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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\



 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690