# vertex is bending inwards

I am trying to draw a picket fence, but the center of the picket vertex looks bent in the middle,

why is the picket bending inwards to the left?

// draw fence pickets
float a;
for (a=-25; a<=25; a+=0.256) {

glBegin(GL_POLYGON);
glColor3f(  1,  1,  1 );
glVertex3f( a,       25, 0 );
glVertex3f( a+0.128, 25, 0 );
glVertex3f( a,       25, 1 );
glVertex3f( a+0.128, 25, 1 );
glEnd();

}


• Since you are drawing a quadrilateral (4 verts), use GL_QUADS instead of GL_POLYGON. – glampert May 4 '14 at 2:53
• @glampert Thanks, that made the rendering a lot faster. – kyle k May 4 '14 at 6:00
• Note that you are using the very old fixed-function pipeline of OpenGL. I would start reading this free book to get up-to date :) arcsynthesis.org/gltut – Roy T. May 4 '14 at 12:01

glVertex3f( a,       25, 0 );