0

我只在 x 方向上做一个圆圈移动。我画了圆圈,但我无法在 x 方向上移动它。我错过了什么吗?

void display()
{
    int count=0;                      //counter for checking purpose only

    glClear(GL_COLOR_BUFFER_BIT);
    drawcircle(xxc,yyc,rr);           //draws a circle
    glFlush();
    xxc=xxc+deltax;                   //increment x coordinate only

    printf("%d",count);               //prints value of count

    if(xxc>100 || xxc<0 ) {           //to move between 100 and 0
        deltax=-deltax;               //for the to and fro motion of circle
    }
    count++;                          //increment count
    glutPostRedisplay();  

}
4

0 回答 0