1
\$\begingroup\$

I'm interested is there a game or at least example which shows how minecraft-like world turn to sphere?

Idea is that there is sphere which consists from cubes like in minecraft but they are on the surface of it. This have to make that player can go around the world.

Math? Code? Examples?

\$\endgroup\$
2
  • \$\begingroup\$ Possible duplicate: gamedev.stackexchange.com/questions/45167/… \$\endgroup\$
    – House
    Jul 17, 2013 at 14:10
  • \$\begingroup\$ A minecraft youtuber named Jeija did this project recently as a proof of concept in minetest, an open-source voxel game engine. Here is his video demonstrating the math behind this: youtube.com/watch?v=joFWr3JzBOI You can download a built version of the version here: github.com/Jeija/spheretest/releases This is not a full version, however, and there are some bugs, but at first glance it works great, with just some minor rendering issues. EDIT: As stated in the comments, the world is not actually spherical but toroidal. \$\endgroup\$
    – sam1370
    Jul 6, 2019 at 4:45

2 Answers 2

2
\$\begingroup\$

You can't represent a sphere by cubes in a nice way. There is always going to be a distortion.

The 'best'/easiest way would probably be a cubemap approach. Check out this page for an interesting discussion about it. The image about halfway down of a cube and sphere shows the distortion of the squares. It is quite large.

If you are not constrained to cubes, then this question recieved a lot of useful information regarding spherical representatons. Triangles or hexagons are a slightly better fit than cubes.

\$\endgroup\$
2
  • \$\begingroup\$ Does anyone tried to "fold" minecraft-like world on sphere and calculated smallest distortion to make it look like flat? Anyway I mustn't go all down to center - just a layer. \$\endgroup\$
    – arseniuss
    Jul 17, 2013 at 8:59
  • \$\begingroup\$ You could try somethign like this to fake it: gamedev.stackexchange.com/questions/17567/… \$\endgroup\$
    – DaleyPaley
    Jul 17, 2013 at 9:04
0
\$\begingroup\$

If the player won't be able to ever see it as a sphere (eg. by going to high altitude), you can fake it. Make 'normal' voxel world, but wrap it at the borders. Trying to load chunk [-1, 5]? Return [MAX_CHUNK, 5]. Want to visit [MAX_CHUNK+1, 5]? Oh, you mean [0, 5].

This way you won't get nice "hills rising from above the horizon as you get closer" effect, but it can be seen by the player as a normal draw distance limitation. You also will not be able to dig a tunnel through the core of the planet. On the other side, programming it is pretty straightforward and it should work as fast as normal voxel world.

You can add shader warping the models as if the world was a sphere, but observed curvature might not match world's size.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Note that applying this wrapping on one axis gives you a cylindrical world, and applying it on both axes gives you a torus-shaped world. You can still display it bent like a sphere locally like a Sonic 3 special stage but if the player maps out the connections between distant locations, the map they get won't correspond to a sphere. \$\endgroup\$
    – DMGregory
    Aug 5, 2019 at 11:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .