Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8557211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:31:28+00:00 2026-06-11T15:31:28+00:00

I am working on building a box that the user looks from the inside

  • 0

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.

Here are the attributes I set:

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);

Here is the code that creates the cube:

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();

Here is the code that sets up the camara:

float near_ = 1f;
float far_ = 10.0f;

float halfHeight = near_ * (Radian(m_fov)) / 2.0f;
float halfWidth = (static_cast<float>((m_width)) / static_cast<float>((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();

Here is the code that renders to the screen:

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

And here is a screen shot of what is happening, notice the white line between the blue and black quads:
enter image description here

Here is the texture I am using, resolution 600×450, but line happens at multiple resolutions:

enter image description here

My question is: How do I get rid of that white line?

EDIT: The white lines are only appearing where the top and bottom meet the left and right

EDIT: Updated Code to reflect suggestions

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:31:30+00:00Added an answer on June 11, 2026 at 3:31 pm

    What you’re seeing is simply that you indeed have white in your texture. So the fragments that are on the border of the face end up fetching from the white part (you’ll see that more clearly if you turn a linear filter type on your texture).

    What you can do to fix it:

    1. duplicate the expected colors at the borders of your unwrapped cube texture (add red at left of blue, black at right, blue at top of red and black, and so on for the bottom part…)
    2. Or better, switch your code to use a cubemap rather than a 2d map. They offer proper filtering at cube faces
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on building a little game program like this one for a
Working on building a form with several Databound controls and noticed that can't leave
I am working on building a new build box which I would like to
I'm working on building a block on my site that contains the top 5
I am working on building a PHP based filter that will narrow down a
I'm working on building a MySQL database and I'm thinking that rather than encode
I'm working on building out a standard set of configurations for our cache clusters
I'm working on building a mobile friendly site of our companies main website. The
I'm working on building a database to manage project assignments, and the one part
I'm working on building the Boost platform for a currently unsupported toolchain. Obviously we'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.