Terrain as a globe, any tips?

I was hoping to create terrain as a globe. I wan't to start out by generating the globe or planet based on a few basic parameters and then store it for later. Can anyone put me into the right direction for how to manage this.

I am as new as one gets at this so I'm gratefull for any input you can come with

would be a hard trial but i think if u want to start with a round globe

take a sphere

Thanks for the response,

Don't think I'm not gratefull for the response, but do you have anything more I can go with, I will try fool around with normal flat terrains and then go for the globe implementation when I start understand how things are set up.

I just don't know where to start looking since I don't have any examples to go with, psaudo code is enough for me aswell, I need to dig into the engine so I understand what is happening aswell so getting it on a platter it to much  :smiley:

Well to skiss my plans a tad, I wish to make a small planet which I put the physics engine into play to set gravitation point and so on. This way I can do walk throughs and fool around with the engine.

What you're saying is you want to curve the terrain? You should probably just adapt TerrainBlock.

What about extending TerrainBlock / TerrainPage to the 3rd dimension and interpret the values of a heightmap as vertex offset inward / outward to/from the center of a sphere ?

You could use an Octree to partition the Sphere into cullable blocks according to the Quadtree of TerrainPage / TerrainBlock.

Thanks a lot for he input, I will take this into consideration when I do my thing. I really appreciate the answers and I have a feeling this will not be my last question  :smiley:

I'm actually trying to do the exact same thing you are doing, but what do you mean by taking the height maps to the third dimension? The two dimensional images are basically three dimensions because the colors are being interpreted as Y values, adding another dimension would imply to use two different colors to represent different things am I correct on this?  Ok anyways Ive already thought of a good way to do it but Im second guessing myself since I saw this post.  Thanks


Well this was just a thought, not refined and the details have to be worked out …

Anyways, here is my basic idea:

You take a sphere with vertexes arranged in rings around the z axis of the coordinate system.

Now You need a heightmap with x = nuber of verts on the equator of the sphere and y = number of rings.

You only need the heightmap values actually mapping to a vert, 1 middle of the map x = 1 and max (for the poles) and all for the equator at x = height/2.

Now instead of interpreting each (of the mappable) values of the hightmap as an offset from a given point x, z in the z direction, interpret them as the offset of a vertex on a vector (its normal in a sphere) pointing from the sphere center outwards through that vertex - voila you have bendt the heightmap around the sphere center and the result is somewhat a 3d heightmap.

For large bodies the sphere could be split up into PlanetBlock's building a PlanetPage which is an extended node at the center of the sphere holding (for example) 6 more nodes offset in the directions of a cube enclosing the sphere.

Each of this nodes holds (perhaps) four of the PlanetBlocks or four more Nodes.

So all PlanetPages facing away from the camera could be force culled by a controller and the rest is filtered by the viewing frustum.

Does that make sense ?

(comments welcome :slight_smile: )

My 2 cents: When you are close enough for terrain features to really be visible, it is generally hard to tell it is on the surface of a sphere.  I would probably use a DLOD node or something of the like to swap in a textured sphere when the camera pulls out far enough to know it's a planet.

The problem with that understandably is that if you are trying to manage objects on this sphere then you get into a big hassle trying to jump between them.

I have actually considered this myself.  The idea of building a world literally and using physics (although I think this may be impossible at this point with the physics engine) to keep objects on it and getting closer and closer to real-world simulations in your games.  This would be awesome if you could have a game that is in a truly spherical world.

My cent and a half. :o


This is actually a topic that has started interesting me lately. I've been researching Procedural Planets. Using a Spherical ROAM algorithm for LOD. I haven't actually done any work on it, just reading. But you can do some really interesting things (random seed will generate an entire planet). And you have detail from deep space all the way down to the mud. Here are some links, although the book that I'm reading is:

Texturing & Modeling: A Procedural Approach, Third Edition (The Morgan Kaufmann Series in Computer Graphics) (Hardcover)




Awesome!  I bookmarked those for later reading. :slight_smile:



I implemented a terrain globe test based on Cosmo's continous terrain class. (though diverging greatly)  It works simply by moving the vertices of a terrainblock in a spherical formula.  Have a look!