Square game map rendered as sphere with OpenGL

Posted by Roflha on Game Development See other posts from Game Development or by Roflha
Published on 2012-12-08T05:08:39Z Indexed on 2012/12/08 5:59 UTC
Read the original article Hit count: 237

Filed under:
|
|

Okay so I have been trying to find a good way to do this for a while now and so far I have nothing.

For a hobby project of mine I have created a finite voxel world (similar to minecraft), but as I said, mine is finite. When you reach the edge of it, you are sent to the other side. That is all working fine along with rendering the far side of the map, but I want to be able to render this grid as a sphere.

Looking down from above, the world is a square. I basically want to be able to represent a portion of that square as a sphere, as if you were looking at a planet. Right now I am experimenting with taking a circular section of the map, and rendering that, but it look to flat (no curvature around the edges).

My question then, is what would be the best way to add some curvature to the edges of a 2d circle to make it look like a hemisphere. However, I am not overly attached to this implementation so if somebody has some other idea for representing the square as a planet, I am all ears.

© Game Development or respective owner

Related posts about opengl

Related posts about rendering