#include <GL/glut.h>
#include <math.h>
const int n = 200;
const float R = 0.5;
const float Pi = 3.1415926536;
/*画一个圆*/
void myDisplay1(void)
{
int i;
float x, y;
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
for (i = 0; i < n; ++i)
{
x = R * cos(2 * Pi / n * i);
y = R * sin(2 * Pi / n * i);
glVertex2f(x, y);
}
glEnd();
glFlush
【计算机图形学】实验报告1用OpenGL画线命令绘制一个多边构成图形或场景
最新推荐文章于 2021-10-25 16:31:37 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)