Original Post
hey, i''m sure that this question has been asked many times before, but i too lazy to go search for it. Ü
anyways... i''m working off of NeHe''s heightmap tutorial. i want the camera to move along the ground instead of floating above it. i try to get the height of my current possion by setting my Y position equal to the Height function:
ypos = Height(g_HeightMap, xpos, ypos );
it seems to work in the begining, but it seems like when you reach a slope that is too steep, you go under the surface of the heightmap. did that make any sence? it would be great if anyone could help me. by the way... i am using NeHe''s Height function:
int Height(BYTE *pHeightMap, int X, int Y) // This Returns The Height From A Height Map Index
{
int x = X % MAP_SIZE; // Error Check Our x Value
int y = Y % MAP_SIZE; // Error Check Our y Value
if(!pHeightMap) return 0; // Make Sure Our Data Is Valid
return pHeightMap[x + (y * MAP_SIZE)]; // Index Into Our Height Array And Return The Height
}
-PmanC