我在绘制圆圈时遇到了一个小问题。该函数绘制了一个几乎完整的圆,我只是缺少一点循环。我假设这个问题与自动重绘的东西有关?OpenGl隐式圆圈函数 - 不完整圆圈
下面是函数
for(x = radius; x >= -radius; x -= 0.05) // draw the plot
{
double temp = (radius * radius) - (x * x);
y = sqrt(temp);
glVertex2f(x, y);
}
for(x = -radius; x <= radius; x += 0.05) // draw the plot
{
double temp = (radius * radius) - (x * x);
y = sqrt(temp);
glVertex2f(x, -y);
}
是否有任何其他的代码是有帮助的?
另外,这是在'glBegin(GL_LINE_LOOP)'? – Shahbaz
对不起,我刚刚阅读你的链接..纯粹的无知......我绝对会开始关注......这是一个glBegin(GL_LINE_STRIP) –
一个图像的链接可能会有所帮助。 – Tim