# A tile system... for a sphere?

This topic is 1991 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

So I'm trying to work out how I would go about doing a tile system wrapped around the shape of a 3d sphere (like a planet). I can do this in the shape of a Torus quite easily, but it's a sphere I'm after. I'm not even sure where to begin to be honest.Computer generated spheres (like in maya or 3ds max) seem to use triangles for the poles and the squares squash and stretch to fill the shape, which is just no good for a tiling system for a game.

Any help is appreciated.

Edited by Jossos

##### Share on other sites

I think the easiest would be to have triangular tiles all over the sphere, and generate a sphere like this: http://sol.gfxile.net/sphere/

##### Share on other sites

Actually, I have always seen the subdivided cube approach as probably being easier for this particular item.  You start with 6 faces (2 triangles each of course), when you subdivide you push the new verts out to the sphere boundary repeat.  The advantage is ending up with rectangular areas after each subdivision which keeps the texture mapping simple.

##### Share on other sites

Do you really need to tile the whole sphere at the same time? Maybe you can get away with a tangent plane; whenever the "camera" moves you switch to a nearby tangent plane, pretending that the sphere is flat.

##### Share on other sites

Beside using some ico sphere, there is another way to do it. It might work or not depending on the kind of game you are implementing.

Have your classic 2D tilemap with squares. Make it wrappable. That's it if you got to the end left you will come back to the right, etc.. Like Asteroid but make the camera move instead of the player. Navigating through such a space already give a 'sphere impression' because if you keep going in a direction at some point you will come back to your initial position. It's not 100% accurate though because if you go in diagonal the path would be longer than if you go in a straight direction.

Then the trick is to use a spherical vertex shader to make the 2D plane looks like a sphere. The idea is to rotate each point in function of their distance from the center of the screen. There is not much about it on the web but it's not difficult to implement if you know a bit of GLSL.

The nice thing is that all the logic is very simple because it's still 2D however it gives to the player the illusion that he is playing on a sphere. Here is a proof of concept (a project that I sadly abandoned) :

http://www.zappedcow.com/sphere/

##### Share on other sites

Have your classic 2D tilemap with squares. Make it wrappable. That's it if you got to the end left you will come back to the right, etc.. Like Asteroid but make the camera move instead of the player. Navigating through such a space already give a 'sphere impression' because if you keep going in a direction at some point you will come back to your initial position. It's not 100% accurate though because if you go in diagonal the path would be longer than if you go in a straight direction.

This more of a torus really. But I like this idea a lot, and might just do that.

##### Share on other sites

And what you think about hexagon sphere? Its possible to be done as easy as triangles (becuase its made of them), and also hexagons are nice fields for strategy game (a lot of games use those already).

Edited by Zennoya

##### Share on other sites

Have your classic 2D tilemap with squares. Make it wrappable. That's it if you got to the end left you will come back to the right, etc.. Like Asteroid but make the camera move instead of the player. Navigating through such a space already give a 'sphere impression' because if you keep going in a direction at some point you will come back to your initial position. It's not 100% accurate though because if you go in diagonal the path would be longer than if you go in a straight direction.

This more of a torus really. But I like this idea a lot, and might just do that.

In case you're curious, the perspective would end up looking something similar to this:

Actually those special stages pull off that very same trick (OK, not exactly given the hardware that was on, but I mean it was just a 2D plane with a fake sphere look). I don't think anybody ever bothered to wonder how those special stages would map to an actual sphere.

##### Share on other sites

And what you think about hexagon sphere? Its possible to be done as easy as triangles (becuase its made of them), and also hexagons are nice fields for strategy game (a lot of games use those already).

It's not possible to make a sphere out of hexagons, without a few pentagons

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5
A4L
12

• 11
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633723
• Total Posts
3013541
×