5/15/2023 0 Comments Terragen vector fieldsIt represents the scale of the terrain in metres per terrain unit. The "SCAL" marker is followed by three intel-ordered 4-byte floating point values (x,y,z). In non-square terrains, n is equal to the number of data points along the shortest side.Įxample: a terrain with a heightfield 300 points in the x-direction and 400 points in the y-direction would have a size value of 299. In square terrains, n is the number of data points on a side of the elevation image. The "SIZE" marker is followed by a 2-byte integer value equal to n - 1, followed by 2 bytes of padding. ypts is equal to the number of data points in the y-direction in the elevation image. The "YPTS" marker is followed by a 2-byte integer value ypts, followed by 2 bytes of padding. xpts is equal to the number of data points in the x-direction in the elevation image. The "XPTS" marker is followed by a 2-byte integer value xpts, followed by 2 bytes of padding. The actual scale value for a particular terrain is stored in its "SCAL" chunk. If you need to convert from metres, the default scale is 30 metres to one terrain unit. Please note that all distance units (X, Y and Z) are in Terrain units, and not metres. Future versions of Terragen may support compression of the data, or a more efficient storage method, but until then the elevation data is stored in an "ALTW" chunk. A 4-byte "EOF " string at the end of the file (necessary for old versions of Terragen).įollowing these, the actual elevation data may be described.If the terrain is not square, "XPTS" and "YPTS" chunks are required.An 8-byte "TERRAIN " string located 8 bytes from the beginning of the file.An 8-byte "TERRAGEN" string at the beginning of the file.Terrain file chunks do not include a "length of data" value.Ī terrain file must contain the following: Note: The structure of a chunk in a terrain file is different from that of the chunks found in some other Terragen files. However, if you are writing out terrain files, beware that some chunks must appear before others.Īll chunks are aligned to the nearest 4 bytes. The positions of the various chunks are not rigidly defined, so if you are writing a terrain file reader it should allow for the flexibility of chunk positioning. Terragen™ Terrain file specification File Structure Ī terrain file contains a 16-byte identifier followed by a number of chunks.
0 Comments
Leave a Reply. |