title: Not all of my lines are drawing in sfml vertexArray
body: <p>So I have been working on a project with a friend but I've hit a dead end with the following code.
      // The initial angle (for the first vertex)
      double angle = PI / 2;
      //double angle=0;
      int scale = 220;
      int centerX = 300;
      int centerY = 250;</p>
  
  <pre><code>// Calculate the location of each vertex
  for(int iii = 0; iii &lt; vertices.getVertexCount(); iii++) {
      // Adds the vertices to the diagram
      vertices[iii].position = sf::Vector2f(centerX + cos(angle) * scale, centerY -    sin(angle) * scale);
      vertices[iii].color = sf::Color::White;
  
      // Calculates the angle that the next point will be at
      angle += q*(TAU / p);
  }
  
  // Draws the lines on the diagram
  sf::VertexArray lines = sf::VertexArray(sf::Lines, vertices.getVertexCount());
  for(int iii = 0; iii &lt; lines.getVertexCount()-1; iii+=2) {
      lines[iii] = vertices[iii];
      lines[iii+1] = vertices[iii+1];
      lines[iii].color = sf::Color(255,(iii)*50,255,255);//sf::Color::White;
      lines[iii+1].color = sf::Color(255,(iii+1)*50,255,255);//sf::Color::White;
  }
  return lines;
  </code></pre>
  
  <p>The compiler doesn't give any errors but when I run the code exactly half of the lines show up, but only if p is an even number (p is the number of vertices in the polygon.) For example when I try to draw a square p=4 2 lines will show up if I try to draw a pentagon p=5 all of the lines show up.
  On a different forum someone suggested adding 0.5f to the coordinates of all vertices to change how openGl rounds. I tried this but it didn't work.</p>