   Squares
  I need to do something like this:(only the squares)iMAGE  glBegin(GL_LINE_LOOP);for(i=0;i<2;i++){   for(j=0;j<2;j++)   { glVertex3f(i,j,1);   }}But i get something like a hourglassAnd if i try to fill it should i use TRIANGLE_STRIP or QUAD_STRIP?   
  Setting aside the issue of the advisability of using immediate mode, to understand why you're getting an hourglass shape, draw on a piece of paper the vertices in the order they're submitted, and then connect them with line segments. As you'll see, the resulting shape is an hourglass shape.To get a square, submit the vertices in the appropriate order. Using a triangle or quad strip might work with your current order though (I'd have to check the documentation though - I can't remember off the top of my head in what order the vertices are expected).   ;  It's working whit TRIANGLE_STRIP but the lines that are connecting the points aren't making squaresglBegin(GL_TRIANGLE_STRIP);for(i=0;i<16;i++){    for(j=0;j<16;j++)    {    glVertex3f(i,i,0);    glVertex3f(i,j,0);    glVertex3f(j,i,0);    }}glEnd();;  Check the OpenGL documentation to see what order the vertices of a triangle strip are expected to be in. (It doesn't look like you're submitting the correct vertices, or submitting them in the correct order.)Also, keep in mind that some shapes can't be created with a single triangle strip unless you introduce degenerate triangles.   ;  Just to add to what's been said., while your debugging I think you should reduce your poly count to a bare minimum and scale it as you get it working. Start with a 1x1 primitive, then 2x2, then keep doubling until your confident your dilogarithm works. Starting with 16 x 16 creates a mess, with a small set of points you'll be able to visually determine whats gone wrong.   