hello guys, i need your help with this… i’ve been trying to render an arc in OpenGL but all i’m getting at always is an oval…
here is the code
private void renderArc(float x, float y, float width, float height,
float start, float end, int cap)
{
float theta;
float angle_increment;
float x1;
float y1;
angle_increment = (float) (2 * MathHelper.pi()) / 90;
GL11.glPushMatrix();
GL11.glTranslatef(x + (width / 2), y + (height / 2), 0);
this.setProperties();
GL11.glBegin(cap);
for (theta = start; theta < end + angle_increment; theta += angle_increment)
{
x1 = (float) ((width / 2) * Math.cos(theta));
y1 = (float) ((height / 2) * Math.sin(theta));
GL11.glVertex2f(x1, y1);
}
GL11.glEnd();
GL11.glPopMatrix();
GL11.glColor3f(1.0f, 1.0f, 1.0f);
}