Terrain

section index

## NAME

Terrain-Functions

## DESCRIPTION

Under this Section we find the Function to create and modify terrains. As base of a Terrain you need 'heightmap', thats a simple grayscaled image. Based on the brightness, irrlicht creates a Mesh from that data. The terrain scene node is capable of very quickly loading terrains and updating the indices at runtime to enable viewing very large terrains. It uses a CLOD ( Continuous Level of Detail ) algorithm which updates the indices for each patch based on a LOD ( Level of Detail ) which is determined based on a patch's distance from the camera. The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ). The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1 the step taken, in generating indices increases by - 2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch, so having a LOD of 8, with a patch size of 17, is asking the algoritm to generate indices every 2^8 ( 256 ) vertices, which is not possible with a patch size of 17. The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 8 vertices ) and LOD 4 ( every 16 vertices ).

## NAME

IrrAddTerrain - create a terrain node from a highfield map

## SYNOPSIS

IrrAddTerrain(filename.s)

## INPUTS

filename.s | - | name of the xml file

## FUNCTION

Adds a terrain scene node to the scene graph

## RESULT

#Null if no node created, otherwise the pointer to the node.

Contents=

- IrrTerrainGetCenter
- IrrTerrainGetIndexCount
- IrrTerrainHeight
- IrrTerrainOverrideLODDistance
- IrrTerrainSetCameraMovementDelta
- IrrTerrainSetCameraRotationDelta
- IrrTerrainSetDynamicSelectorUpdate
- IrrTerrainSetLODOfPatch
- Terrain