Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

LandscapeMesh Class Reference

quadMesh structure designed for loading in height maps, showing the resulting terrain and applying diamond square subdivision More...

#include <LandscapeMesh.h>

Collaboration diagram for LandscapeMesh:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LandscapeMesh ()
 constructor
virtual ~LandscapeMesh ()
 destructor
void loadRawFile (char *path, int size)
 load a heightmap (raw-file) at a specified path with size size*size
void setRoughness (float rough)
void setSubStep (int substep)
void setHeightFactor (float new_factor)
 set the height factor with which the y-coordinates of the mesh will be multiplied and compute the new normals (costly!!!)
void showNormals (bool)
 show the normals if true
void showSteigung (bool)
 show the gradient of the mesh if true
void showTexture (bool)
void showSolid (bool)
void init ()
void render ()
 write the openGL code to render the mesh

Private Member Functions

void computeSubdivision ()
void computeNormals ()
 compute the normals for all vertices of the mesh

Private Attributes

Vertices vValues [513][513]
Normal nValues [513][513]
UVCoord uvValues [513][513]
float grValues [513][513]
Normal n32Values [32][32]
Normal n64Values [64][64]
Normal v128Values [128][128]
Normal v256Values [256][256]
float size
int sub
bool showN
bool showS
bool showT
bool showSol
int textureCount
float roughness
double maxSteigung
double heightFactor

Detailed Description

quadMesh structure designed for loading in height maps, showing the resulting terrain and applying diamond square subdivision

Mesh structure designed for quad landscape meshes. Data is loaded from height maps. The resulting terrain is rendered using quad or triangle strips. Normals are computed which can also be shown. the steps of diamond square algorithm can be set and the heightfactor computes is factor with which the height of the terrain is multiplied


Constructor & Destructor Documentation

LandscapeMesh::LandscapeMesh  ) 
 

constructor

Parameters:
the stepSize between two vertices of the mesh

LandscapeMesh::~LandscapeMesh  )  [virtual]
 

destructor


Member Function Documentation

void LandscapeMesh::computeNormals  )  [private]
 

compute the normals for all vertices of the mesh

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

void LandscapeMesh::computeSubdivision  )  [private]
 

void LandscapeMesh::init  ) 
 

void LandscapeMesh::loadRawFile char path,
int  size
 

load a heightmap (raw-file) at a specified path with size size*size

Parameters:
path to the heightmap
size of one row of the heightmap (since it is not stored in the .raw file)

void LandscapeMesh::render  ) 
 

write the openGL code to render the mesh

void LandscapeMesh::setHeightFactor float  new_factor  ) 
 

set the height factor with which the y-coordinates of the mesh will be multiplied and compute the new normals (costly!!!)

Parameters:
new height factor

void LandscapeMesh::setRoughness float  rough  ) 
 

void LandscapeMesh::setSubStep int  substep  ) 
 

void LandscapeMesh::showNormals bool  s  ) 
 

show the normals if true

Parameters:
true - show the normals

void LandscapeMesh::showSolid bool   ) 
 

void LandscapeMesh::showSteigung bool  s  ) 
 

show the gradient of the mesh if true

Parameters:
true - show the gradient

void LandscapeMesh::showTexture bool   ) 
 


Member Data Documentation

float LandscapeMesh::grValues[513][513] [private]
 

double LandscapeMesh::heightFactor [private]
 

double LandscapeMesh::maxSteigung [private]
 

Normal LandscapeMesh::n32Values[32][32] [private]
 

Normal LandscapeMesh::n64Values[64][64] [private]
 

Normal LandscapeMesh::nValues[513][513] [private]
 

float LandscapeMesh::roughness [private]
 

bool LandscapeMesh::showN [private]
 

bool LandscapeMesh::showS [private]
 

bool LandscapeMesh::showSol [private]
 

bool LandscapeMesh::showT [private]
 

float LandscapeMesh::size [private]
 

int LandscapeMesh::sub [private]
 

int LandscapeMesh::textureCount [private]
 

UVCoord LandscapeMesh::uvValues[513][513] [private]
 

Normal LandscapeMesh::v128Values[128][128] [private]
 

Normal LandscapeMesh::v256Values[256][256] [private]
 

Vertices LandscapeMesh::vValues[513][513] [private]
 


The documentation for this class was generated from the following files:
Generated on Mon Jan 24 17:42:33 2005 for Loud and Proud by doxygen 1.3.8