Original Post
Hey, I'm trying to texture a sphere. This is the result:
I was expecting a normal earth texture... but this one is obviously wrong. and this is what I'm doing: any help? Thanks
I was expecting a normal earth texture... but this one is obviously wrong. and this is what I'm doing:
ilInit();
ilGenImages(1, &texId);
ilLoadImage("textures/EarthMap_768x384.jpg");
ilConvertImage(IL_RGB, IL_UNSIGNED_BYTE);
glGenTextures(1, ℑ);
glBindTexture(GL_TEXTURE_2D, image);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, ilGetInteger(IL_IMAGE_BPP), ilGetInteger(IL_IMAGE_WIDTH),
ilGetInteger(IL_IMAGE_HEIGHT), 0, ilGetInteger(IL_IMAGE_FORMAT), GL_UNSIGNED_BYTE,
ilGetData());
ilDeleteImages(1, &texId);