Re: about transparency

Hi Zhaopeng,

I can't see any problem with your code. It is very
similar to visad/examples/Test61.java, which works fine.

It could be that your data do not contain enough
zero values to create much transparency.

Cheers, Bill

On Mon, 15 Apr 2002, Zhaopeng Lei wrote:

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