PDA

View Full Version : How to map texture to a half sphere?



Totti
01-14-2007, 09:15 AM
In my 3D game, I want to create a plain map with walls surrounding it. When players look up , they see the sky.
The problem goes here. I want to map a sky texture to a large sphere that is surrounding my map.
Is this method good, will it poor in performance? If I only want to map to the upper half of the sphere, could it be possible?

glAren
01-15-2007, 04:25 AM
This is often solved with skybox textures. These textures are rendered with 90 degrees apect ratio and put onto the box around the scene. See e.g. this site for examples: http://www.scentednectar.com/skyboxes/

Totti
01-21-2007, 11:04 PM
i know it is not difficult to paste in to plane surface, how about a real sphere? paste the sky texture into a large sphere, could it be possible?

Totti
01-21-2007, 11:08 PM
i know it is not difficult to paste in to plane surface, how about a real sphere? paste the sky texture into a large sphere, could it be possible?

crouchingchicken
01-31-2007, 10:34 PM
You can use spherical texture coordinates to map the 2d texture to the sphere. Of course it will just be an approximated sphere (e.g. an icosahedron or some other polyhedron or subdivided surface). The poles of the sphere will look smudged up, but you can point the pole horizontally and hide them behind your walls perhaps. Its definitely doable programatically. If you can get your hands on a 3d modelling app(e.g Blender), you can create a texture mapped half sphere very easily but of course you'll need to importer it into your game.