Re: how to make polygons created by idlgrpolygon transparent? [message #36222] |
Thu, 28 August 2003 10:52 |
Karl Schultz
Messages: 341 Registered: October 1999
|
Senior Member |
|
|
"seunghun lee" <shl@nist.gov> wrote in message
news:31b36665.0308280849.4f19b2ce@posting.google.com...
> is there a keyword in the idlgrpolygon command to make the object
transparent?
>
You can do it with a texture map.
Suppose that you wanted a translucent red polygon with 50% opacity:
; make a 2x2 RGBA texture
texture = BYTARR(4,2,2)
texture[0,*,*] = 255 ; red channel
texture[3,*,*] = 128 ; alpha channel
oTexture = OBJ_NEW('IDLgrImage', texture)
oPolygon->SetProperty, TEXTURE_MAP=oTexture, TEXTURE_COORD=FLTARR(2,nverts)
You have to supply texture coordinates, one per vertex. In this case, the
values of the texture coordinates do not really matter since all texels have
the same value, so 0.0 is fine.
Karl
|
|
|