Texture 2D or 3D?

hi, iam trying to do this:

glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);		

glBindTexture(GL_TEXTURE_2D,NAMEtext);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_2D);

but i have a problem, the texture is for a Sphere made with glutSolidSphere altered with Scale along the Z_axis, and i get it done, but the texture is not disperserd into the z_axis. It does not get the aspect i want, am i giving some bad arguments or is it supposed to happen?

thanks u’ve been great =)

glut primitives like sphere do not generate texture cordinates.

If you want a textured sphere you have to use gluSphere with the texture feature turned on. “gluQuadricTexture”

GLint list[1]; //make globle

void draw_sphere()
{
GLUtriangulatorObj *sphere; // local

glNewList(list[0], GL_COMPILE);
sphere = gluNewQuadric();
gluQuadricOrientation( sphere, GLU_OUTSIDE);
gluQuadricDrawStyle( sphere, GLU_FILL);
gluQuadricNormals( sphere, GLU_SMOOTH);
gluQuadricTexture( sphere, GL_TRUE);
gluSphere( sphere, 8, 4, 4);
glEndList();
gluDeleteQuadric( sphere );
}

Originally posted by hellox:
[b]
hi, iam trying to do this:

glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);

glBindTexture(GL_TEXTURE_2D,NAMEtext);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_2D);

but i have a problem, the texture is for a Sphere made with glutSolidSphere altered with Scale along the Z_axis, and i get it done, but the texture is not disperserd into the z_axis. It does not get the aspect i want, am i giving some bad arguments or is it supposed to happen?

thanks u’ve been great =)

[/b]