title: Removal of White Line on intersection of 2 quads in opengl
body: <p>I am working on building a box that the user looks from the inside out, a sky box or some thing of the sort. I am doing this by taking 6 quads and creating a cube with them and then putting the theoretical camera inside the cube and texturing the cube with an image. The user can look around by using the mouse and the cube rotates making as seem that one is moving their head. i have run in to a problem with a white line appearing at the intersections of the two sides, I have tried pulling in the quads while keeping the size of the actual quads the same. i have made sure that the clear color was black and I am still getting the white line.</p>
  
  <p>Here are the attributes I set:</p>
  
  <pre><code>glClearColor(0.0, 0.0, 0.0, 0.0); 
  glEnable(GL_DEPTH_TEST);
  glClear(GL_COLOR_BUFFER_BIT);
  
  glClearDepth(1);
  //S is the side length of the cube
  float s = 5;
  glShadeModel(GL_SMOOTH);
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  
  glHint(GL_POLYGON_SMOOTH, GL_NICEST);
  
  glEnable(GL_POLYGON_SMOOTH);
  
  glDisable(GL_COLOR_MATERIAL);
  glDisable(GL_LIGHTING);
  
  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
  
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  </code></pre>
  
  <p>Here is the code that creates the cube:</p>
  
  <pre><code>float s = 5; //S is the side length of each quad
  glNewList(m_cube, GL_COMPILE);
      {
          glPushMatrix();
          {
              glEnable(GL_TEXTURE_2D);
  
              glPushMatrix();
              {
  
                  glBegin(GL_QUADS);
                  {
  
                      //front
                      {
                          glTexCoord2f(0.5f, (1.0f / 3.0f));
                          //       glColor3f(1, 0, 0);
                          glVertex3f(((s / 2.0f)), ((s / 2.0f)),
                                     -((s / 2.0f))); //1
  
                          glTexCoord2f(0.25f, (1.0f / 3.0f));
                          //       glColor3f(1, 1, 0);
                          glVertex3f(-((s / 2.0f)), ((s / 2.0f)),
                                     -((s / 2.0f))); //2
                          glTexCoord2f(0.25f, (2.0f / 3.0f));
                          //       glColor3f(1, 0, 1);
                          glVertex3f(-((s / 2.0f)), -((s / 2.0f)),
                                     -((s / 2.0f))); //3
                          glTexCoord2f(0.5f, (2.0f / 3.0f));
                          //       glColor3f(1, 1, 1);
                          glVertex3f(((s / 2.0f)), -((s / 2.0f)),
                                     -((s / 2.0f))); //4
                      }
  
                      //left
                      {
                          glTexCoord2f(0.25f, (1.0f / 3.0f));
                          //       glColor3f(1, 0, 0);
                          glVertex3f(-((s / 2.0f)), ((s / 2.0f)),
                                     -((s / 2.0f))); //2
                          glTexCoord2f(0.0f, (1.0f / 3.0f));
                          //       glColor3f(1, 1, 0);
                          glVertex3f(-((s / 2.0f)), ((s / 2.0f)),
                                     ((s / 2.0f))); //5
                          glTexCoord2f(0.0f, (2.0f / 3.0f));
                          //       glColor3f(1, 0, 1);
                          glVertex3f(-((s / 2.0f)), -((s / 2.0f)),
                                     ((s / 2.0f))); //6
                          glTexCoord2f(0.25f, (2.0f / 3.0f));
                          //       glColor3f(1, 1, 1);
                          glVertex3f(-((s / 2.0f)), -((s / 2.0f)),
                                     -((s / 2.0f))); //3
                      }
  
                      //right
                      {
                          glTexCoord2f(0.75f, (1.0f / 3.0f));
                          //       glColor3f(1, 0, 0);
                          glVertex3f(((s / 2.0f)), ((s / 2.0f)),
                                     ((s / 2.0f))); //7
                          glTexCoord2f(0.5f, (1.0f / 3.0f));
                          //       glColor3f(1, 1, 0);
                          glVertex3f(((s / 2.0f)), ((s / 2.0f)),
                                     -((s / 2.0f))); //1
                          glTexCoord2f(0.5f, (2.0f / 3.0f));
                          //       glColor3f(1, 0, 1);
                          glVertex3f(((s / 2.0f)), -((s / 2.0f)),
                                     -((s / 2.0f))); //4
                          glTexCoord2f(0.75f, (2.0f / 3.0f));
                          //       glColor3f(1, 1, 1);
                          glVertex3f(((s / 2.0f)), -((s / 2.0f)),
                                     ((s / 2.0f))); //8
                      }
  
                      //back
                      {
                          glTexCoord2f(1.0f, (1.0f / 3.0f));
                          //       glColor3f(1, 0, 0);
                          glVertex3f(-((s / 2.0f)), ((s / 2.0f)),
                                     ((s / 2.0f))); //5
                          glTexCoord2f(0.75f, (1.0f / 3.0f));
                          //       glColor3f(1, 1, 0);
                          glVertex3f(((s / 2.0f)), ((s / 2.0f)),
                                     ((s / 2.0f))); //7
                          glTexCoord2f(0.75f, (2.0f / 3.0f));
                          //       glColor3f(1, 0, 1);
                          glVertex3f(((s / 2.0f)), -((s / 2.0f)),
                                     ((s / 2.0f))); //8
                          glTexCoord2f(1.0f, (2.0f / 3.0f));
                          //       glColor3f(1, 1, 1);
                          glVertex3f(-((s / 2.0f)), -((s / 2.0f)),
                                     ((s / 2.0f))); //6
                      }
  
                      //top
                      {
                          glTexCoord2f(.5f, 1.0f);
                          //       glColor3f(1, 0, 0);
                          glVertex3f(((s / 2.0f)), -((s / 2.0f)),
                                     ((s / 2.0f))); //7
                          glTexCoord2f(0.25f, 1.0f);
                          //       glColor3f(1, 1, 0);
                          glVertex3f(-((s / 2.0f)), -((s / 2.0f)),
                                     ((s / 2.0f))); //5
                          glTexCoord2f(0.25f, (2.0f / 3.0f));
                          //       glColor3f(1, 0, 1);
                          glVertex3f(-((s / 2.0f)), -((s / 2.0f)),
                                     -((s / 2.0f))); //2
                          glTexCoord2f(.5f, (2.0f / 3.0f));
                          //       glColor3f(1, 1, 1);
                          glVertex3f(((s / 2.0f)), -((s / 2.0f)),
                                     -((s / 2.0f))); //1
                      }
  
                      //bottom
                      {
                          glTexCoord2f(.5f, (1.0f / 3.0f));
                          //       glColor3f(1, 0, 0);
                          glVertex3f(((s / 2.0f)), ((s / 2.0f)),
                                     -((s / 2.0f))); //4
                          glTexCoord2f(0.25f, (1.0f / 3.0f));
                          //       glColor3f(1, 1, 0);
                          glVertex3f(-((s / 2.0f)), ((s / 2.0f)),
                                     -((s / 2.0f))); //3
                          glTexCoord2f(0.25f, 0.0f);
                          //       glColor3f(1, 0, 1);
                          glVertex3f(-((s / 2.0f)), ((s / 2.0f)),
                                     ((s / 2.0f))); //6
                          glTexCoord2f(.5f, 0.0f);
                          //       glColor3f(1, 1, 1);
                          glVertex3f(((s / 2.0f)), ((s / 2.0f)),
                                     ((s / 2.0f))); //8
                      }
  
                  }
                  glEnd();
  
              }
              glPopMatrix();
              glDisable(GL_TEXTURE_2D);
          }
          glPopMatrix();
      }
      glEndList();
  </code></pre>
  
  <p>Here is the code that sets up the camara:</p>
  
  <pre><code>float near_ = 1f;
  float far_ = 10.0f;
  
  float halfHeight = near_ * (Radian(m_fov)) / 2.0f;
  float halfWidth = (static_cast&lt;float&gt;((m_width)) / static_cast&lt;float&gt;((m_height))) * halfHeight;
  glViewport(0, 0, m_width, m_height);
  
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  
  glFrustum(-halfWidth, halfWidth, -halfHeight, halfHeight, near_, far_);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  </code></pre>
  
  <p>Here is the code that renders to the screen:</p>
  
  <pre><code>void VideoStreamer::render()
  {
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
  float pitch = clamp(Degree(m_pitch), Degree(-(80.f)), Degree(80.f));
  float yaw = wrap(m_yaw, Degree(0), Degree(360));
  float roll = wrap(m_roll, Degree(0), Degree(360));
  glPushMatrix();
  {
      glLineWidth(5);
      glPushMatrix();
      {
          if (1)
          {
              glRotatef(pitch, 1.0, 0.0, 0.0);
              glRotatef(yaw, 0.0, 1.0, 0.0);
              glRotatef(roll, 0.0, 0.0, 1.0);
          }
  
          glCallList((m_cube));
      }
      glPopMatrix();
  }
  glPopMatrix();
  SDL_GL_SwapBuffers();
  }//end render
  </code></pre>
  
  <p>And here is a screen shot of what is happening, notice the white line between the blue and black quads:<br>
  <img src="https://i.stack.imgur.com/PO1vb.png" alt="enter image description here"></p>
  
  <p>Here is the texture I am using, resolution 600x450, but line happens at multiple resolutions:</p>
  
  <p><img src="https://i.stack.imgur.com/fjEpm.png" alt="enter image description here"></p>
  
  <p>My question is: How do I get rid of that white line?</p>
  
  <p>EDIT: The white lines are only appearing where the top and bottom meet the left and right</p>
  
  <p>EDIT: Updated Code to reflect suggestions</p>