[java] Loading raw heightmaps
Hey there, i'm looking into loading heightmaps into my java application, but I don't know how to go about loading the data. I see the two kings (http://www.two-kings.de/tutorials/terrain/terrain01.html) gathers the data and places it into an unsigned char array. When trying to load it in java, I am not getting the same results, and even if i pattern the raw file (i'm saving it using photoshop), i don't seem to get data that is consistant with the image.
How should i go about doing this?
cheers
A byte in Java is signed when you convert it to other types, e.g. float, convert the value to a int first and AND:ing with 0xFF.
int val = (int)byteVal & 0x00FF;
int val = (int)byteVal & 0x00FF;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement