comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Is it possible a transparent image in space ???
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Is it possible a transparent image in space ??? [message #38857 is a reply to message #38794] Wed, 31 March 2004 01:02 Go to previous message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
Hi Rick,

sorry to bother you another time but i just seeing some examples found
in google about texture maps transparencies and i think i am doing the same.

My code is a little big (is part of a more big program) so i put some
important lines.
(I have one IDLgrModel and put a polygon with a texture_map and a simple
IDLgrImage.)


-First i create two IDLgrImage ('oXImage' and 'ximage'. 'oXImage' will
be a texture map and 'ximage' will be a simple image put on a IDLgrModel):

Note: The first data i put into image DATA is not an alpha image. I
create later this.

;Imagen corte X
img_x_data = data_vol[0,*,*]
img_x_data = REFORM(img_x_data, sizes[1], sizes[2])
oXImage = OBJ_NEW('IDLgrImage', img_x_data, $
XCOORD_CONV=xconv, YCOORD_CONV=yconv, ZCOORD_CONV=zconv, $
PALETTE=sEstado.oPalPolygon, BLEND_FUNCTION=[3,4])
sEstado.oXSlideImage = oXImage
sEstado.oHolderTemp->Add, oXImage

ximage = OBJ_NEW('IDLgrImage', img_x_data, $
XCOORD_CONV=xconv, YCOORD_CONV=yconv, ZCOORD_CONV=zconv, $
PALETTE=sEstado.oPalPolygon, BLEND_FUNCTION=[3,4])
sEstado.oTopModelVol->Add, ximage
sEstado.ximage=ximage


-Then i create one IDLgrPolygon and assing oXImage as a texture_map:

oXSlide = OBJ_NEW('IDLgrPolygon', COLOR=[255,255,255], $
[[0,0,0],[0,y,0],[0,y,z],[0,0,z],[0,0,0]], $
THICK=2, STYLE=2, $
XCOORD_CONV=xconv, YCOORD_CONV=yconv, ZCOORD_CONV=zconv, $
TEXTURE_MAP=oXImage, TEXTURE_COORD=[[0,0], [1,0], [1,1],[0,1], [0,0]])
sEstado.oVolumeModelVol->Add, oXSlide
sEstado.oXSlide = oXSlide

-Final when i move the polygon i caught some data, convert to alpha
image and assign to both texture_map image and simple image:

...
c[*,*,0] = red(img_x_data[*,*])
c[*,*,1] = green(img_x_data[*,*])
c[*,*,2] = blue(img_x_data[*,*])
c[*,*,3] = 100

sEstado.ximage->SetProperty, DATA=c, INTERLEAVE=2, $
XCOORD_CONV=xconv, YCOORD_CONV=yconv, ZCOORD_CONV=zconv
sEstado.oXSlideImage->SetProperty, DATA=c, INTERLEAVE=2, $
XCOORD_CONV=xconv, YCOORD_CONV=yconv, ZCOORD_CONV=zconv


The result is: the simple image put on the IDLgrModel is transparent but
the texture map not.

I think it is the same as all examples.


Well, if you arrive here a lot of thanks for your patient and time :)

--------
Antonio.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Finding the closest value in an array...
Next Topic: Re: changing button text for dialog_message

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:11:20 PDT 2025

Total time taken to generate the page: 0.00385 seconds