Jump to content
  • Advertisement
Sign in to follow this  
lazy_hack

problem in embedding texture on polygon

This topic is 3068 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

Hi, I have this problem when I try to embed texture on a polygon. The portion of the polygon that's not covered by the texture automatically takes the background color of texture. I want the background polygon to be white.Please help.
[source lang= "c"]
glBindTexture(GL_TEXTURE_2D,image);
// image contains the texture to be embedded
glColor3f(1.0,0.0,0.0);    
	glBegin(GL_POLYGON);
	      glVertex3f(-3.0,-2.0,0.0);
		  glVertex3f(-3.0,2.0,0.0);
		  glVertex3f(3.0,2.0,0.0);
		  glVertex3f(3.0,-2.0,0.0);
         glEnd();
	glBegin(GL_POLYGON);
	         glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, -0.1);
	         glTexCoord2f(0.0, 1.0); glVertex3f(-2.0, 1.0, -0.1);
	         glTexCoord2f(1.0, 1.0); glVertex3f(2.0, 1.0, -0.1);
                 glTexCoord2f(1.0,0.0);  glVertex3f(2.0,-1.0,-0.1);
	  			 			 
	glEnd();

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!