AbstractHeightMap heightmap = new AbstractHeightMap() {
@Override
public boolean load() {
int terrainSize = 256;
size = terrainSize;
// clean up data if needed.
if (null != heightData) {
unloadHeightMap();
}
heightData = new float[size * size];
// transfer temporary buffer to final heightmap
for (int i = 0; i < cords.size(); i++) {
setHeightAtPoint(cords.get(i).getY(), cords.get(i).getX(), cords.get(i).getZ());
System.out.println(cords.get(i).getY());
}
setHeightAtPoint(200f, 1, 1);
normalizeTerrain(1);
return true;
}
};
heightmap.load();
TerrainQuad terrain = new TerrainQuad("asdf", 256, 513, heightmap.getHeightMap());
Material mat = new Material(assetManager, "Materials/newMat.j3md");
terrain.setMaterial(mat);
These are my Coordinates heights from cords.get(i).getY()
100
105
106
110
40
30
10
5
80
33
But my height doesnt seem to change, e.g when i put in 150 instead of cords.get(i).getY()
well it did change, you said it turned all red when you add +20 there.
so it means:
+0 → all green
+20 → all red
so shader seen difference in height correctly. you just have this difference too low it seems. so like i said you need adjust this 2 lines in shader to match your terrain.
well definetly something is wrong with it, because since you said your terrain lowest value is in (0,0,0) (box that was in middle) this should be almost RED.