#include "myTerrainTechnique.h" #include using namespace osgTerrain; myTerrainTechnique::myTerrainTechnique(void) : osgTerrain::GeometryTechnique() { OSG_ALWAYS<init() calls technique->generateGeometry() which creates the drawable according to the heightfield. To modify the height, the heightfield must be modified prior to the original techniques init() function. To modiy the drawable shape (e.g. Cutting wholes in the area), the function technique->generateGeometry() must be modified. */ HeightFieldLayer* hfl = dynamic_cast( getTerrainTile()->getElevationLayer() ); osg::HeightField* h = hfl->getHeightField(); h->setHeight( 0,0, 1000); GeometryTechnique::init(dirtyMask, assumeMultiThreaded); }