The gaps were caused by using GL_LINES, which draws line segments between successive pairs or vertices. Incrementally drawing a path with successive vertices is what GL_LINE_STRIP is for.