3D World - Sky and Ground

Hi,
I am working on my first 3D world and have two polygons that represent my sky and ground planes. They are parallel and will never meet geometrically. I want to have visibility out to about a mile and I want to see a horizon, where the sky and ground meet. Do I accomplish this by setting up my Projection Matrix ie. my glFrustrum correctly? Any comments would be appreciated.

Chris

No, you can’t get them properly meet unless you make the sky slightly curved. That means a little more polys, but it’s not going to kill your app. Another option are is using a skybox, but with that it’s difficult to get the clouds move.

-Ilkka

Thanks Ilkka for your reply. So I basically make the sky curved like a dome and have the edges meet the ground plane someplace way off in the distance. Do I have to make the “far clip plane” in my gluPerspective call go past where the ground meets the sky for the horizon to be visible?

Yes, that’s right. Technically you do have to push the far plane beyond the horizon line, but if this is a problem (because of z-fighting), you can draw the sky first without depth testing, and then draw the rest of the scene on top of it. This way the size of the dome doesn’t matter, since it’s always drawn behind everything else. Just make sure the dome is always centered to the camera.

-Ilkka

Thanks again for your response. I understand what to do now. :slight_smile:

Mister coffee , take a look at my site. There you will find samples of skyboxes and a skydome algorithm I wrote… They will help you out.
http://cheo.resnet.wayne.edu/miguel

Originally posted by Coffeeman:
Thanks again for your response. I understand what to do now. :slight_smile: