Skydome effect?

I was wondering if anyone has had any experience coding a skydome effect to show sky textures, clouds and stuff? I have a good general idea as how to do it using fanned triangle in the shape of a half sphere but actually implementing it in VC++ 6.0 is proving to be a bit tricky. Any suggestions, links, whatever would be appreciated. Thanks

You can use a cube and 6 textures to do it. If you disable lighting and draw the cube with the viewpoint in the center, it works well. You can also then use a program like pov-ray to render the textures, which lets them be pretty much perspective correct as well, so long as you don’t move the viewpoint relative to the cube.

i think a triangle fan would be nice.
you’d just need 8 -10 textured triangles, and you could put quads with nice environment textures like mountains or buildings on the end of each triangle as well…

how is it done in common games?

I’m experimenting with a sky-cone in my engine and it seems to work quite well. Plus it can scroll and such.

basically I do something like this:

#define SKY_SEGS 32
#define CLOUD_SCALEX 4.0f
#define CLOUD_SCALEY 5.0f
#define SKY_HEIGHT 64.0f
#define SKY_LOW -10.0f
#define SKY_RADIUS 160.f

static float sky_x = 0, sky_y = 0;
float cx, cy

…Add code to bind cloud texture here

glBegin( GL_TRIANGLE_FAN );

// Set top of cone here
glTexCoord2f( 0.0f * CLOUD_SCALEX + sky_x, 0.0f * CLOUD_SCALEY + sky_y );
glVertexf( 0.0f, SKY_HEIGHT, 0.0f );

// Now do the cone base
for ( t=0; t<SKY_SEGS; t++ )
{
cx = cos( j / (float)SKY_SEGS * ( 2 * PI ));
cy = sin( j / (float)SKY_SEGS * ( 2 * PI ));

glTexCoord2f( cx * CLOUD_SCALEX + sky_x, cy * CLOUD_SCALEY + sky_y );
glVertexf( cx * SKY_RADIUS, SKY_LOW, cy * SKY_RADIUS );
}
glEnd();

// scroll the sky texture
sky_x += 0.1f;
sky_y += 0.2f;


As I’ve mentioned, this seems to work quite well. Additionally, in my engine I only rotate the sky-cone to match the player view, I never translate it.

[This message has been edited by Geoff (edited 06-18-2000).]