2014-05-20
展开全部
先定义#define GL——PI 3.1415
GLfloat x,y,z,angle;
glPushMatrix();
glTranslatef(300,200,0);
glColor3f(0.0f,0.5f,0.5f);
glBegin(GL_POINTS);
for(angle=0.0f;angle<2*GL_PI;angle+=0.01f)
{
x=150.0f*sin(angle);
y=150.0f*cos(angle);
glVertex2f(x,y);
}
glEnd();
glPopMatrix();
GLfloat x,y,z,angle;
glPushMatrix();
glTranslatef(300,200,0);
glColor3f(0.0f,0.5f,0.5f);
glBegin(GL_POINTS);
for(angle=0.0f;angle<2*GL_PI;angle+=0.01f)
{
x=150.0f*sin(angle);
y=150.0f*cos(angle);
glVertex2f(x,y);
}
glEnd();
glPopMatrix();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询