title: OpenGL Pixel Gap between translated squares
body: <p>I have run into an issue that there is occasionally one pixel holes along the join between 2 objects which have the same set of vertices, but translated to be next to each other. I managed to reproduce this with a line of simple squares.</p>
  
  <p>The squares are 1 unit by 1 unit with 0,0 centre. I positioned a number of these squares in a line, using glTranslatef to move each square into position (the values I provide are always integers in this case). I found that when the camera is at certain positions OpenGL leaves a single pixel gap between these squares through which I can see whatever is behind (e.g. the colour I cleared the back buffer to). Changing the squares vertices to have 0,0 in a corner did not solve the issue.</p>
  
  <p>Example code:</p>
  
  <pre><code>glPushMatrix();
  glTranslatef(0, 0, 0);
  drawSquare();
  glPopMatrix();
  
  glPushMatrix();
  glTranslatef(0, 0, 1);
  drawSquare();
  glPopMatrix();
  
  glPushMatrix();
  glTranslatef(0, 0, 2);
  drawSquare();
  glPopMatrix();
  </code></pre>
  
  <p>The image shows such a case. I added a red circle to the screen shot around the problem pixel.</p>
  
  <p><img src="https://i.stack.imgur.com/407HF.png" alt="Image"></p>
  
  <p>I have no idea why this is the case, and while specifying the final "world" coordinates eliminating the per square translations for simple squares is possible (and solves the problem), doing so with the far more complicated geometry where I first noticed the issue is not really practical.</p>