I use this method, which works great to draw a full circle (there may be typos in the text of the code I wrote from memory):
drawCircle(GLAutodrawble drawble){ GL gl = drawble.getGL(); gl.glTranslatef(0.0f,0.0f,-7.0f); gl.glBeginf(GL_LINE_LOOP); gl.glColorf(0.0f,0.0f,0.0); final dobule PI = 3.141592654; double angle = 0.0; int points = 100; for(int i =0; i < points;i++){ angle = 2 * PI * i / points; gl.glVertexf((float)Math.cos(angle),(float)Math.sin(angle)); } gl.glScalef(1.0f,1.0f,0.0f); gl.glEnd(); }
I want to use the same prefixes to make a method to make half a circle, I donβt understand what I have to do with cos sin material. Can someone take a look and help me.
Thanks to everyone who looks at the problem!
source share