How to render a earth or teapot with texture?

This is my code, but it doesn’t work.
void DrawEarth()
{
glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP); glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT,GL_TEXTURE_WRAP_S,GL_CLAMP);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT,GL_TEXTURE_WRAP_T,GL_CLAMP);
LoadBMPff(“earth.bmp”);
glutSolidSphere(1,50,50);
}
what’s wrong with my code?
Who can give me some example?

Recently I have noticed that the number of off topic posts has been increasing. It seems we get at least a couple a day now (posts completely unrelated to Opengl or posts that aren’t advanced). What is it that is soooo hard to understand about the heading “OpenGL coding: advanced”? Is the word “coding” causing some sort of confusion?

And of course we get posts like “How to render a(n) earth or teaport with (a) texture?”. A post so profound that the creators of 3d graphics are scrambling to find an answer to this question. John Carmack is probably cancelling all future development to find out how this can be done. People are pouring over the design of GPU’s to see if they can somehow be made to perform this highly advanced function.

But the problem is they are given insufficient information. One of the things I hate the most about my line of work is that you almost always get a bug report that goes something like this:

It doesn’t work
So no doubt, houdy, the answer to the question:

what’s wrong with my code?
Should be phrased as:

It doesn’t work
Your problem could be something dumb like the function “LoadBMPff(“earth.bmp”);” doesn’t bind your texture (or even create it - HTF would we know this). But irrespective of what the problem is, people have been texturing objects for years now, using multiple techniques (including sphere mapping - go figure), so this is in no way an advanced question.

If you can’t find any examples yourself using something google , nVidia or ATI , then why would we bother finding them for you?

Originally posted by rgpc:
Recently I have noticed that the number of off topic posts has been increasing. It seems we get at least a couple a day now (posts completely unrelated to Opengl or posts that aren’t advanced). What is it that is soooo hard to understand about the heading “OpenGL coding: advanced”? Is the word “coding” causing some sort of confusion?

My thoughts exactly.

Originally posted by rgpc:
[b]
And of course we get posts like “How to render a(n) earth or teaport with (a) texture?”. A post so profound that the creators of 3d graphics are scrambling to find an answer to this question. John Carmack is probably cancelling all future development to find out how this can be done. People are pouring over the design of GPU’s to see if they can somehow be made to perform this highly advanced function.

[/b]
LOL! :smiley:

-SirKnight

Oh and houdy, if you can’t texture map an object how do you expect to do bump mapping as you requested in another post?

That’s a thinker…

-SirKnight

Is there a way to flag stuff like this to request a moderator move it? Seems to be a lot of this stuff cluttering the place lately.

Originally posted by houdy:
This is my code, but it doesn’t work.
void DrawEarth()
{
glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP); glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT,GL_TEXTURE_WRAP_S,GL_CLAMP);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT,GL_TEXTURE_WRAP_T,GL_CLAMP);
LoadBMPff(“earth.bmp”);
glutSolidSphere(1,50,50);
}
what’s wrong with my code?
Who can give me some example?

Probably it’s just wrong to use cube mapping to map a normal texture on a surface… for more if cubemapping wasn’t even enabled…

The problem is, and always has been, exagerated and accelerated by people complaining about posts being off-topic but then proceeding to answer the question because they just can’t resist it. If you answer the question then more irrelevant questions will eventually descend on this forum, by word of mouth.

Holy Cow! Texture map? What’s that?

…Must be some uber advanced technique to make “stuffs” look more real.