Welcome to the new look of TurboSquid. To switch to the Classic site, click the link in the Footer.

Skybox- red sunset

All Extended Uses
Included Formats
Windows Bitmap
Specifications
Product ID:263829
Published:
Width:512
Height:512
Color Depth:24 bit
Tileable:No
Alpha Channel:No
Multiple Layers:No
Animated:No
Artist
TurboSquid Member Since January 2005
Currently sells 7 products
Achievements:
Unrated
Product Rating
Categories
Description
Suggested code usage (this example with OpenGL):

drawSkyBox(CVector *cameraposition)
{
//ensure distance not greater than max see-able
float vizdepth=70.0f;

        float minx = cameraposition.x - vizdepth;
        float maxx = cameraposition.x + vizdepth;
        float minz = cameraposition.z - vizdepth;
        float maxz = cameraposition.z + vizdepth;
        float miny = cameraposition.y - vizdepth;
        float maxy = cameraposition.y + vizdepth;


glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

glDepthMask(GL_FALSE); //don't write to depth buffer
glDisable(GL_LIGHTING); //so join between box isn't seen

glBindTexture(GL_TEXTURE_2D, m_toptexture);
glBegin(GL_QUADS);                
        glTexCoord2f(0.0f, 0.0f); glVertex3f(minx, maxy, maxz);
        glTexCoord2f(1.0f, 0.0f); glVertex3f(minx, maxy, minz);
        glTexCoord2f(1.0f, 1.0f); glVertex3f(maxx, maxy, minz);
        glTexCoord2f(0.0f, 1.0f); glVertex3f(maxx, maxy, maxz);
glEnd();

//back
glBindTexture(GL_TEXTURE_2D, m_backtexture);
glBegin(GL_QUADS);                
        glTexCoord2f(0.0f, 0.0f); glVertex3f(maxx, miny, maxz);
        glTexCoord2f(1.0f, 0.0f); glVertex3f(minx, miny, maxz);
        glTexCoord2f(1.0f, 1.0f); glVertex3f(minx, maxy, maxz);
        glTexCoord2f(0.0f, 1.0f); glVertex3f(maxx, maxy, maxz);
glEnd();
                        
//front
glBindTexture(GL_TEXTURE_2D, m_fronttexture);
glBegin(GL_QUADS);                
        glTexCoord2f(0.0f, 0.0f); glVertex3f(minx, miny, minz);
        glTexCoord2f(1.0f, 0.0f); glVertex3f(maxx, miny, minz);
        glTexCoord2f(1.0f, 1.0f); glVertex3f(maxx, maxy, minz);
        glTexCoord2f(0.0f, 1.0f); glVertex3f(minx, maxy, minz);
glEnd();
                
//LEFT
glBindTexture(GL_TEXTURE_2D, m_lefttexture);
glBegin(GL_QUADS);                
        glTexCoord2f(0.0f, 0.0f); glVertex3f(minx, miny, maxz);
        glTexCoord2f(1.0f, 0.0f); glVertex3f(minx, miny, minz);
        glTexCoord2f(1.0f, 1.0f); glVertex3f(minx, maxy, minz);
        glTexCoord2f(0.0f, 1.0f); glVertex3f(minx, maxy, maxz);
glEnd();

//right
glBindTexture(GL_TEXTURE_2D, m_righttexture);
glBegin(GL_QUADS);                
        glTexCoord2f(0.0f, 0.0f); glVertex3f(maxx, miny, minz);
        glTexCoord2f(1.0f, 0.0f); glVertex3f(maxx, miny, maxz);
        glTexCoord2f(1.0f, 1.0f); glVertex3f(maxx, maxy, maxz);
        glTexCoord2f(0.0f, 1.0f); glVertex3f(maxx, maxy, minz);
glEnd();

glEnable(GL_LIGHTING);
glDepthMask(GL_TRUE);

Related Products
More Products by Artist