   Texturing Haywire
  Hello to all. I'm currently facing a problem. I've currently set a texture however i'm not sure why the texture seems to be distorted. I've attached a photo of the texture and my code for initialising the texture and applying it is as suchinitialising of the texturetex_image[0] = LoadBMPFile("woodenfloor.bmp");tex_image[1] = LoadBMPFile("wall.bmp");tex_image[2] = LoadBMPFile("check.bmp");for (int i = 0;i < 3; i++){glGenTextures(1,  &textureID);   // generate textureglBindTexture(GL_TEXTURE_2D, textureID);gluBuild2DMipmaps(GL_TEXTURE_2D, 3, imageWidth, imageHeight, GL_RGB, GL_UNSIGNED_BYTE, tex_image);  }glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);glEnable(GL_TEXTURE_2D);// enable 2D texturing  The code for applying it to the textureglBindTexture(GL_TEXTURE_2D, textureID[2]);glMaterialfv(GL_FRONT, GL_AMBIENT, gAmbientfloor);glMaterialfv(GL_FRONT, GL_AMBIENT, gDiffusefloor);glBegin(GL_QUADS);glNormal3f(0.0f, 0.0f, 1.0f);glVertex3f(-100.0f, 0.0f, 80.0f);glTexCoord2f(0.0f, 0.0f);glVertex3f(100.0f, 0.0f, 80.0f);glTexCoord2f(1.0f, 0.0f);glVertex3f(100.0f, 100.0f, 80.0f);glTexCoord2f(1.0f, 1.0f);glVertex3f(-100.0f, 100.0f, 80.0f);glTexCoord2f(0.0f, 1.0f);glEnd();
  The problem is caused by the texture coords. You have to define them before defining the vertex position, so how you wrote it you'r defining the tex coords everytime for the next vertex;  Oh now i understand.Thank you thank you for the help   