Bonjour! j'ai un énorme problème. J'ai essayé d'appliquer une texture sur ma sphère avec la librairie devil, avec opengl et glut et aucun n'a fonctionné. Le pire c'est que meme avec les tutos je comprend pas pourquoi ca marche pas je fais tout pareil pourtant! Au lieu que la texture s'affiche la sphère prend une couleur unie!
ca c'est mon code :
GLUquadricObj *Quadric1 = gluNewQuadric();
chargeSphere();
glPushMatrix();
glEnable(GL_TEXTURE_2D);
glTranslated(0,0,-15);
glRotatef (rx,1.0,0.0,0.0);
glRotatef (ry,0.0,1.0,0.0);
glRotatef (rz,0.0,0.0,1.0);
glBindTexture (GL_TEXTURE_2D, texID);
gluSphere(Quadric1, 5,25, 25); )
gluQuadricTexture(Quadric1, GL_TRUE);
glPopMatrix();
et ca c'est ma fonction qui charge une texture :
void chargeSphere()
{
AUX_RGBImageRec *texture1;
texture1 = auxDIBImageLoad("texture.bmp");
glGenTextures (1, &texID);
glBindTexture (GL_TEXTURE_2D, texID);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, 3, texture1->sizeX, texture1->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, texture1->data);
};
est ce que quelq'un voit ce qui ne va pas? merci d'avance