PDA

View Full Version : Transparency problem



Roach
10-04-2000, 05:26 AM
Greetings,
Does any one have any familerarity with creating simi-transparent models? I am trying to have a cone type structure positioned over a globe. I need to have the cone structure transparent over the globe so that I can see the items that are under the cone. (I hope I discribed this enough). As of right now, it is not transparrent, though I am following what my book tells me to do. Here's a snipit of the code.

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glColor4f(0.7, 0.7, 0.0, 0.1);
glBegin(GL_POLYGON);
.
. // Stuff to make the cone.
.
glEnd();

Any ideas? http://www.opengl.org/discussion_boards/ubb/confused.gif

Thanks
Roach

jc
10-04-2000, 06:25 AM
Hello, is you'r cone textured ??

If it is, u should also add the gl command:

glEnable(GL_TEXTURE_2D);

JC

phlake
10-04-2000, 09:14 AM
the code snippet you have looks right, what there is of it. could you post more of the code? or possibly email it to me?

Roach
10-04-2000, 10:09 AM
That's the problem. I wish I could poset some more of the code, but it is linked with many other files, some of which are classified. I can only post general openGL() commands on this newsboard!! http://www.opengl.org/discussion_boards/ubb/frown.gif

Thanks!!
Roach

P.S. The object that is below the cone that I am drawing it textured with bit maps. Could that be the reason why I just see black under my cone?

Quint
10-05-2000, 04:22 AM
I assume you draw the object under the cone BEFORE you draw the cone? If it's textured or not shouldn't really matter if you just set some color to it you should atleast se something, try skipping rendering the cone to see that your other object is rendered correctly.