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

Home » Public Forums » archive » Re: semi-transparent IDLgrPolygon? alpha blending no good...
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: semi-transparent IDLgrPolygon? alpha blending no good... [message #30458 is a reply to message #30450] Tue, 23 April 2002 06:10 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sean Dettrick (dettrick@uci.edu) writes:

> Does anyone have a way to make semi-transparent polygon
> objects with IDLgrPolygon?
>
> I would like to use IDL's fancy object graphics, but in my
> attempts so far, alpha blending using a monochrome image only
> makes a polygon object transparent to ITSELF, not to other
> objects. This is pretty useless.
>
> I would like the red cylinder to be semi-transparent, so
> that I can see the black cylinder through it.

I think the problem is the order in which you put
your polygons in the model. I futzed around with
a couple of things that didn't work, then I took
the polygon you call "thisSurface" and added it
to the model *after* the other polygons and Viola!,
just what I wanted!

I'm not sure now exactly what I changed, but here
are the relevant bits, I think.

; Changed the order of the polygons in model

if keyword_set(light) then thisModel->Add, light
if keyword_set(surface2) then thisModel->Add, surface2
if keyword_set(surface3) then thisModel->Add, surface3
if keyword_set(surface4) then thisModel->Add, surface4
thisModel->Add, thisSurface

; Here is how I built the drape for the image object.

alpha = replicate(128,2) # replicate(1,2)
red = replicate(200,2) # replicate(1,2)
green = replicate(20,2) # replicate(1,2)
blue = replicate(20,2) # replicate(1,2)
drape = Bytarr(4, 2, 2)
drape = [[[red]],[[green]],[[blue]],[[alpha]]]

; I made the color of drape image red, so I made the
; polygon color white.

thisSurface = OBJ_NEW('IDLgrPolygon', x, y, z, Style=2, Shading=1, $
polygon=polygon, color=[255,255,255], $
texture_coord= texture_coord,$
texture_map=image )

If you can't get that to work, let me know and I'll send you
the code I have.

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Art and all that Jazz: we converse the weird fig
Next Topic: PPM image from IDLgrBuffer: top-bottom order

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

Current Time: Thu Oct 09 06:58:58 PDT 2025

Total time taken to generate the page: 3.19189 seconds