Lets look, maybe i an help (I’ve done a Texturing class yesterday)
First, I load my Textures like this :
glBindTexture(GL_TEXTURE_2D, Texture); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
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, 3,
Image->sizeX, Image->sizeY,
0, GL_RGB, GL_UNSIGNED_BYTE, Image->data);
Where Image is AUX_RGBImageRec.
I dont think the bug is int this part. But So far just assure, we are loading the texture the same way.
Now here’s the important part:
in your RenderScene method, before glBegin(); and glEnd(); put this:
glTexGenf(GL_S,GL_TEXTURE_GEN_MODE,GL_REFLECTION_MAP_NV);
glTexGenf(GL_T,GL_TEXTURE_GEN_MODE,GL_REFLECTION_MAP_NV);
for Reflection-mapping or this:
glTexGenf(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGenf(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
for sphere-mapping.
NOW, it is URGENT, that you enable the automatic TexCoords generation:
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
And then if your code contains #include <gl/glut.h> put
glutSolidTeapot(double size);
after all that (erverything still in the RenderScene-method, of course)
and you should get a sphere- or reflection- mapped teapot.
easy tough…
Sorry for the layout (Mozilla nightly build is guilty , but FASTEST browser ever seen!!!)