title: How do I change the size of the polygon that is called from a text file?
body: <p>I am having a problem with changing the size of a polygon that I am calling from a text file using vertices. Whenever I try and change the coordinates of the vertices in the text file and run the program the shape stays the same size and when I go back to the text file all the coordinates have changed back. How can I change the shapes size?</p>
  
  <p>Here is the code I'm using for this:</p>
  
  <pre><code>void cal_vertices() {
      // open a file for writing pentagon vertices 
      ofstream outfile("vertices1.txt");
      float a = 2 * 3.1415926 / 5.0;
      float x1 = 0.0, y1 = 1.0;
      outfile &lt;&lt; x1 &lt;&lt; " " &lt;&lt; y1 &lt;&lt; endl;;
      float x, y;
      for (int i = 1; i &lt; 5; i++) {
          x = x1 * cos(a * i) - y1 * sin(a * i);
          y = y1 * cos(a * i) + x1 * sin(a * i);
          outfile &lt;&lt; x &lt;&lt; " " &lt;&lt; y &lt;&lt; endl;;
      }
      outfile.close();
  }
  
  void read_vertices() {
      //reads verticies from the text file
      ifstream infile("vertices1.txt");
      for (int i = 0; i &lt; 5; i++){
          infile &gt;&gt; vertices[i][0];
          infile &gt;&gt; vertices[i][1];
          cout &lt;&lt; vertices[i][0] &lt;&lt; " " &lt;&lt; vertices[i][1] &lt;&lt; endl;
      }
  }
  
  void init(){
  
      cal_vertices();
      read_vertices();
  
      glNewList(listname, GL_COMPILE);
      glColor4f(red, green, blue, 1.0);
  
      glBegin(GL_LINE_LOOP);
      for (int i = 0; i &lt; 5; i++){
          glVertex3f(vertices[i][0], vertices[i][1], 0.0);
  
      }
      glEnd();
      glEndList();
  </code></pre>