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

Home » Public Forums » archive » Re: Translucent polygons
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: Translucent polygons [message #41146] Wed, 29 September 2004 10:11
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
dteira wrote:
> Hello, I'm trying to draw 2 superposed polygons but I want to see the one
> in the back. I think I'm trying to make a traslucent polygon. Is this
> possible in IDL 5.6?.

Yes you can, in object graphics. It has been covered here many times
before in one way or another so you'll want to google this group for
more info.

In short you texture map your polygons with a 4 channel texture image:
R,G,B,A. The A is the alpha channel which denotes the transparency of
each pixel. 0 is clear, 255 is opaque. Note that you need to ensure
that your objects are drawn back to front.

Without getting into the details, say you have two planar polygons, one
near (translucent) and one far (opaque):

If you draw the near polygon first, IDL checks what is behind it which
at this point is just the background, and the polygon is rendered as a
mix of the polygon color and the background color. When the far polygon
is drawn, it is drawn behind the near polygon. Looking at the scene,
you see the near polygon is translucent, but it is a mix of the near
polygon color and the background. Not a mix of the near and far polygon
colors you would expect.

Reverse the drawing order. Draw the far polygon. Then draw then near.
When IDL draws the near, it checks what is behind it (the far polygon)
and draws the near polygon as a mix of the near and far polygon colors.
Just what you expected.

You'll want to check out the docs for IDLgrPolygon, especially the
TEXTURE_MAP and TEXTURE_COORD keywords.

-Rick
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Translucent polygons
Next Topic: relocation error: R_SPARC_WDISP30

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

Current Time: Sat Oct 11 14:00:55 PDT 2025

Total time taken to generate the page: 0.79939 seconds