第2问题,怎样画球的形状??
glBegin(GL_TRIANGLE_STRIP);
for (double ang=0;ang<=M_PI*21/20;ang=ang+M_PI/50)
{
double s2=sin(ang);
double c2=cos(ang);
for (double ang=0;ang<=M_PI*21/20;ang=ang+M_PI/10)
{
double s=sin(ang);
double c=cos(ang);
glVertex3d(2.0*c,2.0*s,0.0);
glVertex3d(2.0*c,2.0*s,0.1);
}
glVertex3d(0.2,2.0*c2,2.0*s2);
glVertex3d(0.0,2.0*c2,2.0*s2);
}
什么错?? |