Skip to main content
GameDev.net gamedev.net
🔒 Locked

Transparency Problems

Started by BigDaddyDrew Nov 29, 2003 at 1:52 PM 1 replies 600+ views
Original Post
BigDaddyDrew
BigDaddyDrew
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);
		gluDisk(gluNewQuadric(), 0.0, .2, 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);
		gluDisk(gluNewQuadric(), 0.0, .2, 20.0, 20.0);
		glTranslatef(0.0, 0.0, 0.35);
		gluDisk(gluNewQuadric(), 0.0, .3, 20.0, 20.0);

		glDisable(GL_BLEND);
 
Thanks! Andrew
Cifko
Cifko
Dissable depth test


BigDaddyDrew
BigDaddyDrew
Aha! Thanks a bunch Cifko. That did the trick!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.