0
我正在創建使用在OpenGL掩蓋牆上的洞問題,我的代碼是簡單的退出這樣,的Opengl:與蒙
//Draw the mask
glEnable(GL_BLEND);
glBlendFunc(GL_DST_COLOR,GL_ZERO);
glBindTexture(GL_TEXTURE_2D, texture[3]);
glBegin(GL_QUADS);
glTexCoord2d(0,0); glVertex3f(-20,40,-20);
glTexCoord2d(0,1);glVertex3f(-20,40,40);
glTexCoord2d(1,1);glVertex3f(20,40,40);
glTexCoord2d(1,0);glVertex3f(20,40,-20);
glEnd();
//Draw the Texture
glBlendFunc(GL_ONE, GL_ONE);
glBindTexture(GL_TEXTURE_2D, texture[2]);
glBegin(GL_QUADS);
glTexCoord2d(0,0); glVertex3f(-20,40,-20);
glTexCoord2d(0,1);glVertex3f(-20,40,40);
glTexCoord2d(1,1);glVertex3f(20,40,40);
glTexCoord2d(1,0);glVertex3f(20,40,-20);
glEnd();
的問題是,我在牆上有洞正確,但它是半透明的,我越來越像黑色陰影,也可以看穿它。 這裏是我得到的照片: alt text http://i43.tinypic.com/iw7ju0.jpg
有什麼建議嗎?
隨意接受你自己的答案! – 2010-05-15 10:58:39