我在繪製圓圈時遇到了一個小問題。該函數繪製了一個幾乎完整的圓,我只是缺少一點循環。我假設這個問題與自動重繪的東西有關?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