• Popular Now

• 12
• 9
• 9
• 13
• 10

Archived

This topic is now archived and is closed to further replies.

Transparency Problems

This topic is 5225 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hey guys, I modeled a cup (gluCylinder) and some liquid in the cup (also, gluCylinder). It is my goal that the cup be somewhat transparent, and that the liquid inside also be somewhat transparent, although not as much so. The way I have it now, the cup is transparent, but you can''t see the liquid through the sides. Any ideas? Here is my code:
glEnable(GL_BLEND);

// Cup
glColor4f(1.0, 1.0, 1.0, 0.9);
gluCylinder(gluNewQuadric(), .2, .35, .5, 20.0, 20.0);

// Liquid
glColor4f(.85, .75, .06, 0.6);
gluCylinder(gluNewQuadric(), .15, .25, .4, 20.0, 20.0);
glTranslatef(0.0, 0.0, 0.05);
glTranslatef(0.0, 0.0, 0.35);

glDisable(GL_BLEND);

Thanks! Andrew

Share on other sites
Dissable depth test