[Q]IDLgrImage Blend_Function [message #19394] |
Thu, 16 March 2000 00:00 |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
I have two IDLgrPoly objects, one inside of the other. I have mapped a
JPEG image on the outer object and would like to use alpha blending to
adjust the opacity of the outer object so you can see through it to the
inner object.
I read the JPEG, adjust the array to add a 4th channel and assign all
elements of that channel a value of say 100. (I am assuming that the
alpha
channel ranges from 0..255)
I then create the Image and polygon objects like so:
oImage = OBJ_NEW('IDLgrImage', image, INTERLEAVE=2, $
BLEND_FUNCTION=[3,4], /INTERPOLATE)
state.oFBSurface = OBJ_NEW("IDLgrPolygon", TRANSPOSE([[x],[y],[z]]), $
SHADING=1, POLY=mesh, COLOR=[255,255,255], $
TEXTURE_MAP=oImage, STYLE=2, /TEXTURE_INTERP, $
TEXTURE_COORD=TRANSPOSE([[ynorm],[znorm]]), $
ZERO_OPACITY_SKIP=0)
What I get is an object with my image mapped to it in where the final
image is a function of the original image, the IDLgrWindow's background
color and the values in my alpha channel. In other words, the image
fades out to the background color, but you still can't see what is
"inside" or behind the poly. I can't see the axes which fall inside my
outer object nor can I see the inner object.
Am I approaching this correctly? Can you adjust the opacity of the
texels so you can see other objects behind them in a scene?
Thanks for any help!
-Rick Towler
|
|
|