#include <LandscapeMesh.h>
Collaboration diagram for LandscapeMesh:
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 |
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
|
|
compute the normals for all vertices of the mesh !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// |
|
|
|
|
|
load a heightmap (raw-file) at a specified path with size size*size
|
|
write the openGL code to render the mesh
|
|
set the height factor with which the y-coordinates of the mesh will be multiplied and compute the new normals (costly!!!)
|
|
|
|
|
|
show the normals if true
|
|
|
|
show the gradient of the mesh if true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|