FractalHeightMapGrid to one single TerrainQuad is harder than I thought

Hi, this is my code.

[java]FractalHeightMapGrid grid = new FractalHeightMapGrid(ground, null, 256f);

this.terrain = new TerrainQuad(“terrain”, 65, 513, grid.getHeightMapAt(Vector3f.ZERO).getHeightMap());

// this.terrain = new TerrainGrid(“terrain”, 65, 513, grid);


this.terrain.setLocalTranslation(0, -150f, 0);


List<Camera> cameras = new ArrayList<Camera>();


TerrainLodControl control = new TerrainLodControl(this.terrain, cameras);


I’m trying to just get one single TerrainQuad out of the FractalHeightMapGrid but I’m obviously doing something wrong. (I truly miss the totalSize in my attempt.) If I uncomment line 3 and comment out line 2 (then it is like the TerrainGridTest) it works. I took a look at but still don’t get it. Thanks for any advice.



You’re missing one simple step, that;s happening behind the curtains. Before calling getHeightMapAt(Vector3f) you must call setSize(513). TerrainGrid sets this according to it’s size settings. :slight_smile:

K, thank you. As I said I was missing this setting anyway. ^^ Seems I wasn’t looking properly enough.