vtlib library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
TVTerrain Class Reference
Inheritance diagram for TVTerrain:
Inheritance graph
[legend]

Public Member Functions

DTErr Init (const vtElevationGrid *pGrid, float fZScale)
 initialization
 
- Public Member Functions inherited from vtDynTerrainGeom
DTErr BasicInit (const vtElevationGrid *pGrid)
 
virtual void SetPolygonTarget (int iPolygonCount)
 
int GetPolygonTarget () const
 
int NumDrawnTriangles () const
 
- Public Member Functions inherited from vtDynGeom
int IsVisible (const FSphere &sphere) const
 
int IsVisible (const FPoint3 &point0, const FPoint3 &point1, const FPoint3 &point2, const float fTolerance=0.0f) const
 
int IsVisible (const FPoint3 &point, float radius)
 
bool IsVisible (const FPoint3 &point) const
 
- Public Member Functions inherited from vtGeode
void AddMesh (vtMesh *pMesh, int iMatIdx)
 
void RemoveMesh (vtMesh *pMesh)
 
void AddTextMesh (vtTextMesh *pMesh, int iMatIdx)
 
uint NumMeshes () const
 
vtMeshGetMesh (int i) const
 
vtTextMeshGetTextMesh (int i) const
 
- Public Member Functions inherited from NodeExtension
void SetEnabled (bool bOn)
 
bool GetEnabled () const
 
void SetCastShadow (bool b)
 Set this node to cast a shadow, if it is under a vtShadow node. Default is false.
 
bool GetCastShadow ()
 Get whether this node casts a shadow.
 
void GetBoundSphere (FSphere &sphere, bool bGlobal=false)
 Get the Bounding Sphere of the node.
 

Detailed Description

The TVTerrain class implements the TopoVista algorithm for regular-grid terrain LOD.
This algorithm requires that the input heightfield is a square regular grid, of any size. Storage requirements are around 14 bytes/vertex. The data is represented in memory by a binary tree of faces.
The VTP implementation consists of an adaptation of the author's own source code, made to work in the vtDynTerrainGeom framework.
The algorithm is promising, but needs a lot of work:
  • Doesn't currently address lighting or texturing
  • Doesn't utilize triangle strips
  • Uses a very simple error metric based only on ground (2D) distance
So far i have extended the algorithm in the following ways:
  • Added full 6-plane view-volume culling (instead of the previously simple 2D culling). This required implementing some 3d triangle culling which was mysteriously absent from the computer graphics literature.