Drawing Circle with OpenGL

后端 未结 6 1613
时光取名叫无心
时光取名叫无心 2020-12-31 01:46

I\'m trying to draw simple circle with C++/OpenGl

my code is:

#include 
#include 

void Draw() {
    glClear(GL_COLOR_         


        
6条回答
  •  情歌与酒
    2020-12-31 02:08

    I have done it using the following code,

    glBegin(GL.GL_LINE_LOOP);
         for(int i =0; i <= 300; i++){
             double angle = 2 * Math.PI * i / 300;
             double x = Math.cos(angle);
             double y = Math.sin(angle);
             gl.glVertex2d(x,y);
         }
    glEnd();
    

提交回复
热议问题