The geomap system hasn't been touched in a while, we are still waiting for a certain someone to make a terrain system

Usage is in general easy, you load a heightmap via the GeomapLoader, then you can split the geomap in whatever way you like (optional) and there's a special method to create a mesh out of it. So once you get the mesh you just put it into a geometry, assign a material, and you got terrain.

The map.getValue() method gives you the unscaled height at the given point, if you want to get the actual height, you have to scale it by the Y scale value you gave to the createMesh method.

The map.getValue() method gives you the unscaled height at the given point, if you want to get the actual height, you have to scale it by the Y scale value you gave to the createMesh method.

I tried that already.. :s

Lets say we have a map of 4 * 4 height map values, and it takes up 40 * 40 world units..

With a slight bit of magic, I can have 16 perfect points, but for a proper game I'd need 1600? (actually more but yeah)

- Mikkel

EDIT: I guess I'll just make my map more detailed.
I should be good to go :)
Yep, got it working with a more detailed map. :) (Although its sligthly bumpy, but its good enough really)
If anyone else needs it:

/**
* Gets the height of the {@link Geomap} at a current position.
* @param location The location at which we want the height.
* @return The height of the {@link Geomap}, at the point specified.
*/
public static float getHeight(Vector3f location) {
int x = (int) (location.x / scale.x);
int y = (int) (location.z / scale.z);
return map.getValue(x, y) * scale.y;
}

EDIT2:
And I realized the method from jME2 would spare me the bumps xD

/**
* <code>getHeight</code> returns the height of an arbitrary point on the
* terrain. If the point is between height point values, the height is
* linearly interpolated. This provides smooth height calculations. If the
* point provided is not within the bounds of the height map, 0 is returned.
*
* @param x
* the x coordinate to check.
* @param z
* the z coordinate to check.
* @return the height at the provided location.
*/
public float getHeight(float x, float z) {
x /= SCALE.x;
z /= SCALE.z;
int col = (int) Math.floor(x);
int row = (int) Math.floor(z);

// The height at the upper left corner.
float upperLeft = map.getValue(focalSpot) * SCALE.y;

//The height at the lower right corner.
float lowerRight = map.getValue(focalSpot + map.getWidth() + 1) * SCALE.y;

// Use linear interpolation to find the height.
if(offsetX > offsetY) {
// The height at the upper left corner.
float upperRight = map.getValue(focalSpot + 1) * SCALE.y;

return upperLeft * (1 - offsetX) + upperRight * (offsetX - offsetY) + lowerRight * offsetY;
} else {
// The height at the lower left corner.
float lowerLeft = map.getValue(focalSpot + map.getWidth()) * SCALE.y;

I know this is an old thread, but could you post your basic heightmap loading code? I can't seem to get it working on my end and a working example would be invaluable.