Hi,
I have my little terrain renderer up and running now.
Until now I calculated some perlin noise terrain to play
with, but now I wanted to load heightmaps from files (.raw).
Here’s the way I load 8 bit greyscale heightmaps:
FileInputStream input = new FileInputStream (file);
data = new byte[(int)file.length()];
input.read (data);
After this I convert the values to floats and save them
in my heightmap array.
But this doesn’t work, because it seems as if Java handles those
byte as signed bytes. I tried to add 128.0f
if the read value is below 0.0f but that didn’t help either.
Any ideas?
Adam.