[Contents | Tutorials ]

### Lesson 7: HeightFields

Note: The implementation of heightfields has not been completely established as of this writing, there may be additional heightfield features not listed here.

Heightfields are often used to create ground terrain by generating many rectangles of equal length spacing and equal width spacing but with variable z-axis (height) spacing.

Each heightfield requires two compoents:

- The Heightfield Primitive
- The Heightfield Image Map file

The Heightfield Primitive contains a reference to the position, orientation, size, and heightfield image map.

The heightfield image map is basically an extension of the Targa 8 bit greyscale format (not to be confused with the Targa 8 bit indexed greyscale format). Where each pixel has a value that appears as a shade of grey, the lowest value (hex single `0x00`) would represent the lowest possible height on the heightfield and the greatest value (hex single `0xFF`) would represent the highest possible height.

The number of pixels on the heightfield image map determines the number of grids on the heightfield (thus more pixels produce more detail). However the size (length, width, and height) is determined by the values set on the HeightField Primitive.

A heightfield can also be textured, the texture will be oriented to span the size of the heightfield's own XY plane (note this can be adjusted in future design implementations). All you need is a Texture Select primitive placed before the HeightField Primitive. Also the Color Primitive would apply to the HeightFields in the same way it does to other visual primitives.

Rotations can also be set on the HeightField Primitive, however it is recommended that you only specify heading rotation since rotating of pitch or bank may throw off height contact calculations done by some end implementations which do not take into account pitch or bank.

######

Back to the top

Vertex is Copyright © 2000-2001 WolfPack Entertainment