Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw 3D background in Games

Tags:

opengl-es

3d

I am trying to make a 3d car race in iphone using OPENGL ES 1.x.

I do not know how to draw the background sky in my scene. I tried using only planes for background but where should i placed that plane? I mean if i placed that plane outside the whole track then the frustum is not so big to show that planes in the scene.

Any suggestions will be of great help.

like image 338
LebRon Avatar asked May 09 '11 06:05

LebRon


3 Answers

You can make a small skysphere or box, as suggested by Davido and turbovonce's link, which is centered around the viwer and fits into the frustum. You draw this first, without writing into the depth buffer. Then you draw the other stuff and as the skybox has not written to depth buffer it is just overwritten, except the parts where no scene objects are rendered, which are exactly the parts of the image where the sky should be visible.

like image 167
Christian Rau Avatar answered Sep 27 '22 21:09

Christian Rau


You want a sky dome. Take a look at this website, it contains tons of references that should help you.

http://www.vterrain.org/Atmosphere/

like image 33
vdsf Avatar answered Sep 27 '22 19:09

vdsf


Create a sphere in a 3d modeling app such as Maya or Blender and map a sky texture to the sphere. Export the model then load the model and its texture into the app, place in the scene. You should now have a background sky rendering in your game.

like image 43
Davido Avatar answered Sep 27 '22 20:09

Davido