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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Is it possible a transparent image in space ??? [message #38772] Tue, 30 March 2004 09:38 Go to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Antonio Santiago" wrote ...
> Mmm... i am making crazy.
>
> Just i have put an image with alpha channel in plane XY, and the same
> image as a texture map of a polygon in another plane. TRhe result is the
> image object is transparent but the polygon object (with image texture)
> no!!! argg.
>
> Do you know any example to make this ok? Am i makeing wrong anything?

Why don't you post your simple example? Then we can see what you might be
doing wrong. At this point all you want to do is texture map a polygon with
an image containing an alpha channel. Your example should only be 5 or so
lines. Use XOBJVIEW to display it.

As for examples, I don't know of any in the IDL distribution. I know this
has been covered in depth before in this group. You could use google to
search the archives.

-Rick
Re: Is it possible a transparent image in space ??? [message #38783 is a reply to message #38772] Mon, 29 March 2004 23:06 Go to previous messageGo to next message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
Mmm... i am making crazy.

Just i have put an image with alpha channel in plane XY, and the same
image as a texture map of a polygon in another plane. TRhe result is the
image object is transparent but the polygon object (with image texture)
no!!! argg.

Do you know any example to make this ok? Am i makeing wrong anything?

Thanks anyway.
Antonio.




Rick Towler wrote:
> "Antonio Santiago" wrote...
>
>
>> i know it is possible to put two images in the same "plane" and make one
>> of two semi-transparent to allow see the second image.
>> My question is: Is it possible to create an image as a texture of
>> poligon and make it be transparent in the 3D space? (transparent for
>> other planes).
>
>
> Yes.
>
> Take that image with an alpha channel and apply it as a texture to a planar
> polygon. Position that polygon in space either by manipulating its vertices
> or by transforming the model that contains it.
>
> You must make sure that your objects are drawn back to front (-z to +z)
> otherwise you'll not see the far objects thru the near objects.
>
> -Rick
>
>
Re: Is it possible a transparent image in space ??? [message #38784 is a reply to message #38783] Mon, 29 March 2004 22:46 Go to previous messageGo to next message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
That seems not work.
I have a program similar to d_vectrack, but i want my slices to be
semi-transparent.
I try put on a polygon an image texture (with alpha channel) as you say
but it doesnt works. The image is right visualized but it is not
transparent, it is see lika if it isn't transparent.

I'm continue trying.
Bye and thanks.
Re: Is it possible a transparent image in space ??? [message #38794 is a reply to message #38784] Mon, 29 March 2004 10:31 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Antonio Santiago" wrote...

> i know it is possible to put two images in the same "plane" and make one
> of two semi-transparent to allow see the second image.
> My question is: Is it possible to create an image as a texture of
> poligon and make it be transparent in the 3D space? (transparent for
> other planes).

Yes.

Take that image with an alpha channel and apply it as a texture to a planar
polygon. Position that polygon in space either by manipulating its vertices
or by transforming the model that contains it.

You must make sure that your objects are drawn back to front (-z to +z)
otherwise you'll not see the far objects thru the near objects.

-Rick
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.
  Switch to threaded view of this topic Create a new topic Submit Reply
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 10:58:46 PDT 2025

Total time taken to generate the page: 0.00404 seconds