Generating a heightmap with my own/custom float Array

I’d like to do as the title describes, but all tutorials/documentation i can find is either outdated (jmex, jme2) or outright GONE (TestTerrain : Google Code Archive - Long-term storage for Google Code Project Hosting.)



Closest thing i found in a tutorial told me to use a TerrainBlock, which apparently no longer exists.

(as described in: https://wiki.jmonkeyengine.org/legacy/doku.php/jme2:terrains_heightmaps_texturing )



[java]

float[] map = new float[]

{

150, 255, 200, 255, 200,

150, 200, 250, 255, 200,

100, 100, 150, 200, 100,

100, 100, 000, 050, 150,

000, 050, 000, 000, 000

};

Vector3f scale = new Vector3f(10f, 0.1f, 10f);

TerrainBlock tb = new TerrainBlock(“Simple terrain”, 5, scale, map, new Vector3f(0, 0, 0));

[/java]



i’ve read the following, but they all use either ImageBasedHeightMap or Hill



https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:terrain

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_terrain

TestTerrain.java link is dead, as noted above





So basically my question is: have i missed something, or is there somewhere i haven’t looked at all?

and if not: what do i do ?

I just tried to use TerrainQuad tq = new TerrainQuad(“asd”, 65, 513, map); with you float data array and that seem to work. However this will result in very long spikes so the array contains very big values.

Won’t this just create a very small terrain (5*4 game Units) ?

(I think i tried this, i just got a high spike-mountain, as described by you)

Perhaps i should have elaborated, i intended that a map was to be interpolated procedurally from the float array i give. (perhaps with a few variables like maximum curves and intermittent height differentials)

i’ll get into this after i finish studying for my math test (going for a Bachelors in I©T ) in a few hours.

(feel free to reply in between, i could use the procrastination)



edit

So indeed it makes a very small terrain.

Also i’ve found a version of TestTerrain.java ( http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/terrain/TerrainTest.java?r=5870 ) but that also doesn’t solve my problem.



Anyone got any ideas ?

You want to use jme3test.terrain.TerrainTest as an example. TerrainBlock is jme2, you want to use jme3’s TerrainQuad.

You will have to do the interpolation yourself, there are too many considerations for jme to do it for you when supplying a small heightmap.

will do ,i’ll post my sollution if it’s anywhere near decent