Skip to main content
GameDev.net gamedev.net
🔒 Locked

Height map question

Started by Scooter Jun 30, 2004 at 7:23 PM 4 replies 1.2k views
Original Post
Scooter
Scooter
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.
Promit
Promit
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.
C-Junkie
C-Junkie
When you change the value in the heightmap, are you changing the value used to render the triangles?
rKallmeyer
rKallmeyer
are you addressing the correct cell?
array [y*width + x]
Onemind
Onemind
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.
Deranged
Deranged
a BYTE is not a floating point value and cannot handle decimals, you should use 0 not 0.0f.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.