Some major Terrain questions


Sorry for the noobish nature of my questions. I tried the search button but, well … i found not what i was looking for. So here some questions.

1.) All heightmaps are integers? Is that not a bit … rude? I’m looking for a heightmap model that is using float values. Is that supported?

2.) My area is splitted twice into sub fields (16x16). After reading in that sub fields i noticed this weird lightning problem. How can i solve it?

Not sure how much I can help - being a noob at this too but I would think that representing the heightmap as integers would be feasible since you can always scale it down later to get more precise values. And since there is some deformation going on on the heightmap anyway I doubt that kind of precision is needed.

Cant answer your second question but I have seen lots of postings about a large terrain creator by Llama called jTerra which im pretty confident could help you out.

Sorry for the general uselessness of this reply hehe

I have another similar reply…

I was always under the impression that a heightmap was generated from a regular image. On the image as far as I know, color values are represented as integers. It would not make sense to add a comma there somewhere and make these numbers into floats - you can do that yourself if you want to.

If I am wrong, please correct me… I live to learn :slight_smile:

I guess I don't quite get the problem with lighting!  :?

The point is i allready did some tousand lines of code that load WoW Map Files.

Now the community and the users want a 3d Interpretation of the data. First just to have a viewer. Later maby to insert some edit features.

But to be serious i got problems with jmonkey 3d. Wow have its heightmap as float. So i also need to handle them like this. Not just as integers.

Well you could either implement it using a float system, or you could just convert your floats into an equivalent system of ints.  Ints are not limited to 0-255, you can set any int value within the height change function.

EDIT:  Just so no one misunderstands… I don't mean just cast as an int.  I mean actually convert them so you get the same range of detail using int as you would with the floats.

As previous posters said, multiply your floats so that the biggest possible result gives the 2^31-1 value, then cast to int, and set 1/multiplyer as the terrain scale. You have your fields as separate terrainblocks? If the wow map format does not supply normals, then you will need to fix normals on the bordering vertices. The problem you see is because vertex normals does not take into consideration bordering vertices that are in another block. TerrainPage does fix the normals on bordering vertices. So, either convert your whole map into a single big heightmap (int[][]) and create a terrainpage with it, or you will need to code the fixing of the normals on bordering vertices yourself, like in terrainpage.

Man i was looking for something like this  XD

good idea  :wink:

Hi Ganku!