Campbell Ritchie wrote:Please explain more about what height map is; I am not familiar with it, and maybe other poeple won't be familiar with it.
In the scale method, I can see that 250→2000 is 8, but why are you using 8 1 8?
While my code is not directly from there, there is a good tutorial about heightmaps at
https://www.youtube.com/watch?v=nFrBwkaReJE. Pretty much explains what a HeightMap is in the first minute.
Or, if you're not willing to watch Youtube, it is an image which sets the height of a coordinate of a certain location, meaning that it is a simple and easy way to store a map file. The drawbacks are that I cannot have tunnels, overhangs, etc.
glScalef(8, 1, 8) - glScalef(x, y, z). Both heightmaps have got the exact same height (y). The smaller one just has the X and Z at 8 times less than what they actually are, which is why I only scale those ones up.
If I scaled the Y, not only would it not be accurate with the collision heightmap, but also I would have massive cliffs/peaks instead of small/medium hills.
I am scaling it up because rendering that massive amount of vertices in a display list is impossible without dropping to <10 FPS. Eventually, I will have a chunk mechanism where it scales it less and less and gives a more and more accurate heightmap the closer you get to it, however that will be a while in coming and won't actually solve the 'now' problem.