PDA

View Full Version : cone in tube



Mr J
11-10-2005, 10:46 AM
I have a problem to show the cone inside the tube ? Can I see the cone just change the opacity of the tube from 1 to 0. When I did that, the tube became white instead of transparent. There is any idea to do that ?

Azdo
11-10-2005, 11:22 AM
Did you

// Draw the cone!
glEnable(GL_BLEND);
glColor4f(r,g,b,0.5f);
// Draw the tube!
glDisable(GL_BLEND);in your code?

Vexator
11-10-2005, 12:59 PM
wow you really did it. you posted the same question three times. i'm amazed.

Mr J
11-10-2005, 01:10 PM
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
// Draw Cone
glDisable(GL_BLEND);

glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
// Draw Tube
glDisable(GL_BLEND);
glDisable(GL_DEPTH_TEST);

Is it correct the organize of the code ?
What I want, when I change the alpha value to '0' I can see the cone .....