0
glGenTextures(1, &texName[0]);
glBindTexture(GL_TEXTURE_2D, texName[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, widthImage , widthImage,
0, GL_RGB, GL_UNSIGNED_BYTE, image);
我嘗試將紋理映射到nurbs表面。紋理不映射整個nurbs表面
gluBeginSurface(theNurbs);
gluNurbsSurface(theNurbs, numOfKnots, knots, numOfKnots, knots, ctrNum*3, 3, &tCtrPoint[0][0][0],order, order,GL_MAP2_TEXTURE_COORD_2);
gluNurbsSurface(theNurbs, numOfKnots2, knots2, numOfKnots2, knots2, ctrNum2*3, 3, &ctrPoint[0][0][0], order2, order2, GL_MAP2_VERTEX_3);
gluEndSurface(theNurbs);
的問題是,紋理映射看起來表面的所有區域中,然而,光僅出現在左下小格(白色網格)。另一部分是黑色的。
我要照片,最後整面映射。但我無法弄清楚如何做到這一點。
所以你實際上張貼圖片,而是顯示不正確的紋理圖像,它只是顯示一個15 * 15格,這肯定沒有人有問題可想而知。 –