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

Home » Public Forums » archive » overlay a 3D polygon on a 2D grayscale image?
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: overlay a 3D polygon on a 2D grayscale image? [message #31933 is a reply to message #31871] Fri, 30 August 2002 11:21 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Chunlei Liu" <chunlei@stanford.edu> wrote
>
> Thanks for the tip... I could see both of them now. But I don't know how
> to make the polygon semi transparent. Right now it's not a problem for me,
> since the polygon is small...

You will need to texture map the polygon with an image object which has an
alpha channel. And alpha channel is a 4th channel in an image which
modulates the opacity of an image. values of 0 are transparent and values
of 255 are opaque. There should be enough in the help files to get you
started.

-Rick


>
> On Tue, 27 Aug 2002, Rick Towler wrote:
>
>>
>> "Chunlei Liu" <chunlei@stanford.edu> wrote
>>>
>>> I have a 3D polygon and a 2D grayscale image. I am trying to overlay
the
>>> polygon on the 2D image, so I can see the image through the
>>> semi-transparent polygon. Also, I am NOT intending to use the 2D image
as
>>> a texture map.
>>> I know David Fanning's website has an example of blending two 2D image
>>> together using alpha channel. I tryied to make the 2D image
transparent (
>>> which is not what exactly I want), so I can see the polygon, but seems
>>> like it won't work that way.
>>> Appreciate any help....
>>
>> This could be a number of things.
>>
>> First, make your polygon a wireframe.
>>
>> How have you ordered your objects in Z and how are they ordered in your
>> model? I would assume that you have the correct Z data coordinates
placing
>> your image behind your polygon... Objects are drawn according to their
>> order in which they are added to the OG hierarchy. This means you need
to
>> add atoms from back to front in your scene. If you have only a single
model
>> make sure that you add the image first, then the polygon.
>>
>> Do you see it now? If so, change your polygon to a solid and test your
>> alpha blending. Can you still see it? If not, google this group for
>> "Pimento Problem" to find an detailed explanation of how IDL renders
>> individual atoms and its importance when texturing with an alpha
channel.
>>
>> If you still don't see it make sure your view is set up correctly (maybe
the
>> polygon is behind you?). In fact, try using xobjview to view your
model.
>> It scales the view automagically.
>>
>> -Rick
>>
>>
>>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: OG polygon to EPS problem
Next Topic: CHECK_MATH and exp()

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

Current Time: Mon Dec 01 03:19:35 PST 2025

Total time taken to generate the page: 1.68537 seconds