Hard Light Productions Forums

Off-Topic Discussion => Programming => Topic started by: Stormkeeper on June 26, 2008, 12:33:22 pm

Title: Graphic Issues
Post by: Stormkeeper on June 26, 2008, 12:33:22 pm
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.
Title: Re: Graphic Issues
Post by: blackhole on June 26, 2008, 07:50:54 pm
Maybe post your other graphics functions as reference?