Hello Terrain tute missing a field?

Just wanted to check this before I made any changes to the wiki (still new to this and all).



Exercise 2 in the Hello Terrain tutorial provides the code

[java]heightmap = new HillHeightMap(513, 1000, 50, 100, (byte) 3);[/java]

And then asks, “Which value controls the flattening of the hills?



According to the HillHeightMap entry in the Javadoc, none of them do: only map size, number of hills, min/max radii of hills, and the seed for generating the same heightmap repeatably. Is it perhaps missing NORMALIZE_RANGE?

[java]HillHeightMap.NORMALIZE_RANGE = 100;

heightmap = new HillHeightMap(513, 1000, 50, 100, (byte) 3);[/java]



UPDATE: 16 hours have elapsed, and I have gone ahead and added the NORMALIZE_RANGE assignment to the tutorial code.

I wonder whether the contructor changed since I wrote those exercises?



In any case, you implicitly control the flattening of the hills by manipulating the ratio between min and max, and by choosing very high or very low values. That’s what this exercise was getting at, I changed it now. Thanks for the hint!

1 Like