绘制半长轴和半短轴分别为a,b的椭圆

绘制半长轴和半短轴分别为a,b的椭圆

//绘制半长轴和半短轴分别为a,b的椭圆
void ellipse(double a,double b)
{
int n = 1000;
double t = 0.0;
glBegin( GL_LINE_LOOP);
for (int i = 0; i < n; ++i)
{
t
= i * 2 * 3.14159 / n;
glVertex2f(a
*cos(t), b*sin(t));
}
glEnd();
}
posted @ 2011-06-05 09:57  AndreMouche  阅读(914)  评论(0编辑  收藏  举报