Off-Topic Discussion > Programming

Graphic Issues

(1/1)

Stormkeeper:
No, not with FSO.  :P

Actually, I'm trying to create a skybox, and I'm getting instead of a beautiful textured cube, I have 3 textured sides, two grey-ish sides, and one totally missing. The missing one I can prolly solve easily, but the two grey ones (which I've determined to be the rear and bottom sides), I have no idea.

Code for top surface
void Skybox::DrawRear(GLuint texRear)
{
   glBindTexture(GL_TEXTURE_2D, texRear);
   
   glBegin(GL_QUADS);
   
   glTexCoord2f(0, 0);
   glVertex3f( -35.0f, -35.0f,  35.0f );

   glTexCoord2f(1, 0);
   glVertex3f(  35.0f, -35.0f,  35.0f );

   glTexCoord2f(1, 1);
   glVertex3f(  35.0f,  35.0f,  35.0f );

   glTexCoord2f(0, 1);
   glVertex3f( -35.0f,  35.0f,  35.0f );

    glEnd();
}

Code for bottom surface:
void Skybox::DrawBottom(GLuint texBottom)
{
    glBindTexture(GL_TEXTURE_2D, texBottom);
    glBegin(GL_QUADS);

        glTexCoord2f(0, 0);
      glVertex3f( -35.0f, -35.0f, -35.0f );

        glTexCoord2f(0, 1);
      glVertex3f( -35.0f, -35.0f,  35.0f );

        glTexCoord2f(1, 1);
      glVertex3f(  35.0f, -35.0f,  35.0f );

        glTexCoord2f(1, 0);

      glVertex3f(  35.0f, -35.0f, -35.0f );
    glEnd();
}

Texture binding and loading is called in another section of the code, using a LoadTGA function, which takes in the file name and texture id. Any help would be greatly appreciated.

blackhole:
Maybe post your other graphics functions as reference?

Navigation

[0] Message Index

Go to full version