[問題] OpenGL的texture問題

看板C_and_CPP作者時間13年前 (2011/07/17 23:00), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
開發平台(Platform): VC++ 額外使用到的函數庫(Library Used): OpenGL 問題(Question): 我想要在視窗上同時畫出有texture的polygon 和沒texture的quadratic物件 但是就算我用了gluQuadricTexture(quadratic, GL_FALSE); polygon上的texture還是會自動跑到quadratic物件上 請問這有方法解決嗎? 謝謝 以下是部份程式碼 glColor3f( 1.0f, 1.0f, 1.0f ); glBegin( GL_QUADS ); glTexCoord2f( 0.0f, 0.0f ); glVertex3f( -128.0f, -8.0f, 0.0f ); glTexCoord2f( 1.0f, 0.0f ); glVertex3f( 128.0f, -8.0f, 0.0f ); glTexCoord2f( 1.0f, 1.0f ); glVertex3f( 128.0f, -8.0f, -256.0f ); glTexCoord2f( 0.0f, 1.0f ); glVertex3f( -128.0f, -8.0f, -256.0f ); glEnd(); glTranslatef( 1.0f, 0.0f, -3.0f ); glColor3f( 1.0f, 1.0f, 0.0f ); gluQuadricTexture( quadratic, GL_FALSE ); gluSphere( quadratic, 0.5f, 32, 32 ); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 76.170.150.223

07/17 23:09, , 1F
插入 glDisable(GL_TEXTURE_2D); 看看 XD
07/17 23:09, 1F

07/17 23:18, , 2F
哈哈 忘了還有這招暴力法 謝謝你~
07/17 23:18, 2F
文章代碼(AID): #1E8lZ_yH (C_and_CPP)