PDA

View Full Version : 3D World - Sky and Ground



Coffeeman
03-07-2003, 05:04 AM
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

JustHanging
03-07-2003, 05:33 AM
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

Coffeeman
03-07-2003, 08:38 AM
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?

JustHanging
03-08-2003, 12:37 AM
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

Coffeeman
03-08-2003, 03:17 AM
Thanks again for your response. I understand what to do now. :-)

Miguel_dup1
03-08-2003, 06:30 AM
Mister coffee http://www.opengl.org/discussion_boards/ubb/smile.gif, 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. :-)