Results 1 to 10 of 35

Thread: My own custom world generating heightmap software

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,561

    Default

    The MDR file format is a simple format that consists of a 1024-byte header followed by a raster block of 32-bit floating-point samples. Byte order of all fields and data is Intel order (LSB first). The VC++ structure definition for the file header is shown below:

    Code:
    
    // make sure we're aligned on 2-byte boundaries for this declaration
    #pragma pack(push)
    #pragma pack(2)
    
    // map structure definitions
    struct MDRHeader
    {
    
    	union
    	{
    
    		struct
    		{
    
    			char   Chunk[4];    // name of chunk - should be "WLBR"
    			int    Next;        // offset in file to next data (unused)
    
    			char   Name[256];   // name associated with the data (unused)
    
    			double Left;        // min longitude
    			double Right;       // max longitude
    			double Top;         // max latitude
    			double Bottom;      // min latitude
    
    			double Min;         // lowest point on surface
    			double Max;         // highest point on surface
    
    			double XRes;        // distance between X points (right - left) / XSize
    			double YRes;        // distance between Y points (top - bottom) / YSize
    
    			int    Version;     // version number (unused, should be 0)
    			int    TypeInfo;    // type information (should always be 0)
    			char   SurfName[8]; // name of data block (unused)
    			void** SurfData;    // pointer to surface data (unused)
    
    			char   PicName[8];  // name of picture block (unused)
    			void** PicData;     // pointer to image data (unused)
    
    			int    XSize;       // width of blocks
    			int    YSize;       // height of blocks
    
    		}; // struct
    
    		struct
    		{
    			char Padding[1024]; // make the structure 1024 bytes long
    		};
    
    	}; // union
    
    }; // MDRHeader
    
    #pragma pack(pop)
    There is a problem with 32-bit MDR vs. 64-bit MDR files embodied in the pointers in the structure. There will likely be an offset from 32-bit vs 64-bit files.

  2. #2

    Wip progress update

    Ok, so I made the globe data structure object oriented, re-wrote the plate/tectonic code (I still need to tweak some of the equations), and turned it into a shape that should wrap relatively well onto a globe with a mollweide projection.
    I still need to adjust the erosion calcs for the new map shape.

    evile eagle, thanks for the encouragement!

    waldronate, thanks, that should be enough info to write/read MDR files from my program.

    Click image for larger version. 

Name:	FractalGlobe-14.png 
Views:	160 
Size:	473.6 KB 
ID:	39388

    Click image for larger version. 

Name:	FractalGlobe-15.png 
Views:	143 
Size:	456.3 KB 
ID:	39389

  3. #3

    Default MDR files

    I have it exporting the heightmap in an MDR file now. I have to think about some scaling issues before I let it import MDR files too.

  4. #4

    Default

    Hi JosMetadi (and hi to the full Guild community too, since this is my first post)

    your work is really interesting.
    From the last images is clearly visible where the plates collisions are placed. Could you please explain a bit the algorithm you are using?
    Thanks and keep up the good work!

  5. #5

    Default

    I start with a modified worley generator combined with a fractal factor applied to the radius to determine the shapes of the continents. Each continent is then given a random vector and an average height. By comparing the difference in the vectors for the two nearest continents, the fault line between them is given a type:
    Convergent (they are moving towards each other), in which case the side of the continent with the lower height is assumed to be sliding underneath, and so a trench is created on that side, and a mountain range on the other side of the fault.
    Divergent (they are moving away from each other), in which case it creates mountain ridges on both sides of the fault, but doesn't thrust up the base of the ranges as much.
    Transform (they are moving along each other), right now I don't know have it doing anything for this type, but I obviously need to come up with some idea of how to do some offset displacements to simulate this kind of fault .(http://upload.wikimedia.org/wikipedi...ault-1.svg.png)
    Other (they are moving in the same direction), in which case it doesn't do anything with the fault as there should be miminal tectonic forces.

    Each fault has other random factors applying to it's height, ridge formations and offsets. The goal of these is create some of the linear mountain range and ridge shapes that you don't get out of regular fractal generators.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •