Title: How do I make a geodesic height map? Post by: teoma on April 04, 2007, 12:18:34 PM I'm working on a space exploration game with procedurally generated content. I want to make height-mapped planets, but I can't seem to find a good way to encrypt an array that can cover a sphere.
So far, my best solution is to use an octahedron and turn that into a geodesic sphere. I can make a simple tile array that covers the whole figure using four squares, but setting this up for a fractal heightmap (such as a diamond-square algorithm) becomes difficult because the squares connect in strange ways that are counter-intuitive if you're used to working in 2d space. Any help would be greatly appreciated - I've searched the net - I know it's been done several times before but I can't wrap my brain around it. Title: Re: How do I make a geodesic height map? Post by: lycium on April 04, 2007, 06:16:09 PM here's an article by a good friend: http://freespace.virgin.net/hugo.elias/models/m_landsp.htm (although it doesn't use maps, since any 2d map on the sphere will suffer from distortion)
btw, "encrypt" means something quite different from how you use the word ;) ditto for geodesic. if you're just looking for a good spherical parameterisation (bearing in mind the limitations given by the hairy ball theorem: http://en.wikipedia.org/wiki/Hairy_ball_theorem), then peter shirley has a good post on his blog about that: http://psgraphics.blogspot.com/2007/03/environment-map-formats.html Title: Re: How do I make a geodesic height map? Post by: teoma on April 04, 2007, 11:21:13 PM Thanks - I'm not sure if I descibed my method very well (bear with me - i have no formal math training outside of high school geometry) In my game - from space the planets are spheres with real time rendered cyllindrical maps based on a heightmap - but when you land on them they will appear 'flat' - I know that gives me a bit of a hairy ball problem (they really need a better name for that) - but i think my octahedron method could work to some degree. I think your first link - 'spherical landspcape method' is great - though i don't think i'll use it as intended. As I said before I'm using a set of four squares (8 triangles when folded in half) as four 2d arrays to map a imaginary octahedron - this map is then stretched (the diamonds become squares - if you can picture this) into a cyllindrical map and then applied to the sphere. (there is a little distortion around the poles but for the most part it works fairly well - I may still end up using peter's projection) It would not be difficult (i don't think) to split the octahedron about an arbituary plane and determine which points fall on which side of the plane. Like I said there are two views - the prerendered cyllinder-mapped sphere from space, and a close up view for when you land on the planet which is rendered in realtime. I'll try both methods and see what works - thanks for the help |