(Sorry ! my english not very good)Does opengl smooth need some prerequisite
Recently I draw the earth on the computer but I find that my code can’t realize antialias.And I am sure that there must someting wrong in blow codes,but I do not know where the error.

this is my code :
//////////////////////////////////////////////////////////////

{
//
float alpha_step = 2*PI/h_slip;
float beta_step = PI/l_slip;
float alpha = 0.0f;
float beta = PI;
//
float x = 0;
float y = 0;
float x_step = 1.0f/h_slip;
float y_step = 1.0f/l_slip;

int i;
int j;

for(i=0;i<l_slip;i++){
glBegin(GL_TRIANGLE_STRIP);
for(j=0;j<h_slip;j++)
{

``````}
glEnd();
``````

}

``````glBegin(GL_QUADS);
``````

for(i=0;i<l_slip;i++){
for(j=0;j<h_slip;j++)
{
glNormal3f(sin(beta)*cos(alpha),sin(beta)sin(alpha),cos(beta));
glTexCoord2f(x,y);

``````	   alpha += alpha_step;
glTexCoord2f(x+x_step,y);

beta -= beta_step;
glTexCoord2f(x+x_step,y+y_step);

alpha -=alpha_step;
glTexCoord2f(x,y+y_step);

beta += beta_step;
x += x_step;

alpha +=alpha_step;
}
x =0.0f;
y += y_step;
``````

alpha = 0.0f;
beta -= beta_step;
}
glEnd();
}//endfunc
//////////////////////////////////////////////////////////////

I guess you mean “smooth shading”.
I have no idea about the algebra used in your code, but in a usual code, each vertex has its own normal vector. In your code you have specified one normal vector for 4 vertexes.

glShadeModel(GL_SMOOTH) affects how lights interpolate between vertics, to make it work you have to have gl lights activated and the correct normals set.
The most common problem with this is that the normals are set to the face normal and not averages with neighboring faces
This is not anything like antialising

Looking over your code i can’t see anything obviously wrong with it.

glShadeModel determines how colors between vertices are interpolated.

To get antialiasing you need to implement that specifically.

There are several techniques but the simplest most common and most robust for a scene with triangles is multisample.