Terrain Development Guide
Chapter 2: In Depth - Basic Terrain
Data Structure for Map Files
Before continuing with the description of Elevation and Ecology Map files, it is helpful to understand just how data is stored and used.
The Targetware terrain system employs a simple raster data structure to define the layout of terrain in 3D space. A Raster is a simply a method of organizing data into an equally spaced row-column grid system. At each point established by the intersection of row and column, values of elevation (and land type) are defined. The following figure illustrates this concept.

The Targetware system uses a top-left forward-propagating raster, meaning that the graphics engine is assuming that the first data point is at the top-left corner of the grid, and data progresses from left-to-right top-to-bottom, as if reading Western text.
Graphic images use this same raster format to create images on your computer screen. In this case each "intersection" of row and column represents a pixel in the final image, and stored at that pixel location in the graphics file is a value that translates to a color to present to the screen. Since the format of a graphics files is the same as what we want for a terrain file, Targetware makes use of image files to store the data needed by the terrain engine. The advantage to this is that you can (1) visualize the data, and (2) you can use readily available graphics editors to create and edit your terrain input files. This is a big advantage for open-system development efforts.
|