Re: overlay a 3D polygon on a 2D grayscale image? [message #31968 is a reply to message #31871] |
Tue, 27 August 2002 13:37  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"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
|
|
|