Jump to content
  • Advertisement

Archived

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

BigDaddyDrew

Transparency Problems

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

If you intended to correct an error in the post then please contact us.

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);
		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

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!