Height map question
I'm reading values from a .raw file and storing them in an array ie...
BYTE g_HeightMap[MAP_SIZE*MAP_SIZE];
...so all I have to do is index into the array to get the current height of an objects position. This is probably something dumb cause i'm out of practice, but I can't get the terrain to deform. By this I mean when i change a value in the array the terrain doen't change....
g_HeightMap[10] = 0.0f;
...this does not move the points height to 0.0, what could I be doing wrong?
You could be setting a BYTE to a float value, for one thing.
Although that shouldn't break it...
Although that shouldn't break it...
When you change the value in the heightmap, are you changing the value used to render the triangles?
The change may not be noticable. You should try setting a large block equal to 0 (or some other constant). Also be careful of "0.0f", it might be converted, but I wouldn't take that chance.
a BYTE is not a floating point value and cannot handle decimals, you should use 0 not 0.0f.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement