Mukund

06-26-2010, 01:46 PM

Hello Everyone.

i am building a small game.It has a simple target that keeps moving.i used filled circles as the

target.

This is the code for the circles that i used:

/* Draw 5 Filled Circles at random positions */

for(i = 0; i < 5; i++) {

glBegin(GL_POLYGON);

glColor3fv(Color[COLOR++]); /* Take color from color array */

/* Draw a circle whicn is filled */

for(j = 0; j < 360; j += 10) {

float temp1 = rad * sin(j * (3.14 / 180.0));

float temp2 = rad * cos(j * (3.14 / 180.0));

glVertex2d(CentreX + temp1, temp2 + CentreY);

}

glEnd();

rad -= 25;

}

glFlush();

But im not getting a smooth rendering.The circles are jagged.Is there any way i can give a smooth

rendering?

i enabled GL_POLYGON_SMOOTH.But it is still a little jagged.

IS there any way i can further improve it?Can anyone please help?

Thanks in advance.

i am building a small game.It has a simple target that keeps moving.i used filled circles as the

target.

This is the code for the circles that i used:

/* Draw 5 Filled Circles at random positions */

for(i = 0; i < 5; i++) {

glBegin(GL_POLYGON);

glColor3fv(Color[COLOR++]); /* Take color from color array */

/* Draw a circle whicn is filled */

for(j = 0; j < 360; j += 10) {

float temp1 = rad * sin(j * (3.14 / 180.0));

float temp2 = rad * cos(j * (3.14 / 180.0));

glVertex2d(CentreX + temp1, temp2 + CentreY);

}

glEnd();

rad -= 25;

}

glFlush();

But im not getting a smooth rendering.The circles are jagged.Is there any way i can give a smooth

rendering?

i enabled GL_POLYGON_SMOOTH.But it is still a little jagged.

IS there any way i can further improve it?Can anyone please help?

Thanks in advance.