Hi everyone,
I am drawing some vertices around a primitive using glDrawArrays like:
glDrawArrays(GL_TRIANGLE_S
TRIP, 0, verticesArray);
However, the primitive drawn is very jagged and looks terrible. I tried
enabling anti-aliasing, but that does not help. I tried increasing the
number of points in the vertices array, but it still does not make a
difference. I was wondering if someone can help me with it. Here is
some sample code:
#define M_PI 3.1415926535897932f
int GUI_div = 20;
divinc = M_PI/GUI_div;
// calculate coords
for(i = 0, angle = 0.0; angle < M_PI+.01; i++, angle += divinc)
{
// inside
pos[i][0] = (float)sin(angle) + button->width*0.5f;
pos[GUI_div+GUI_div+1-i][0
] = -pos[i][0];
pos[GUI_div+GUI_div+1-i][1
] = pos[i][1] = (float)cos(angle);
pos[GUI_div+GUI_div+1-i][2
] = pos[i][2] = 0.0f;
}
glEnable(GL_LINE_SMOOTH);
glBegin(GL_TRIANGLE_FAN);
for(i=0; i<GUI_div+GUI_div+2; i++)
{
glTexCoord2fv(tpos[i]);
glVertex3fv(pos[i]);
}
glEnd();
glDisable(GL_LINE_SMOOTH);
increasing the GUI_DIV parameter does not seem to have any effect,
neither does the anti-aliasing command...
Would appreciate any help :)
Thanks
-L
Start Free Trial