Height map question

Started by
4 comments, last by Deranged 19 years, 9 months ago
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?
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
Advertisement
You could be setting a BYTE to a float value, for one thing.

Although that shouldn't break it...
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
When you change the value in the heightmap, are you changing the value used to render the triangles?
are you addressing the correct cell?
array [y*width + x]
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