I used FreeWorld3D to create 2 heightmaps. Both of them feature some small rolling hills, something a player could easily walk over, but not something they could see over. Nice, gentle hills.
I then wrote a very small extension of SimpleGame to see the difference. I imported the 8-bit and everything looked nice, but the shadows were a bit choppy. I guessed 16-bit may have better-quality land, and therefore less choppy shadows. I exported the same heightmap in 16-bit format, then I changed my program to fit the change in heightmap, and when I started the program I was standing under a gigantic cylinder of land… it was quite strange. What is causing this to happen?
Here is my 8-bit code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mappingexperiment2;
import com.jme.app.SimpleGame;
import com.jme.math.Vector3f;
import com.jmex.terrain.TerrainPage;
import com.jmex.terrain.util.RawHeightMap;
/**
*
* @author Tyler
*/
public class MapLoaderTest extends SimpleGame
{
public static void main(String args[])
{
MapLoaderTest app = new MapLoaderTest();
app.setDialogBehaviour(SimpleGame.ALWAYS_SHOW_PROPS_DIALOG);
app.start();
}
protected void simpleInitGame()
{
Vector3f terrainscale = new Vector3f(5f, .25f, 5f);
RawHeightMap myMap = new RawHeightMap("test8bit.raw", 129, RawHeightMap.FORMAT_8BIT, false);
TerrainPage myPage = new TerrainPage("terrain", 33, myMap.getSize(), terrainscale, myMap.getHeightMap(), false);
myPage.setDetailTexture(1,16);
rootNode.attachChild(myPage);
rootNode.updateGeometricState(0.0f, true);
}
}
Here is my 16 bit code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mappingexperiment2;
import com.jme.app.SimpleGame;
import com.jme.math.Vector3f;
import com.jmex.terrain.TerrainPage;
import com.jmex.terrain.util.RawHeightMap;
/**
*
* @author Tyler
*/
public class MapLoaderTest extends SimpleGame
{
public static void main(String args[])
{
MapLoaderTest app = new MapLoaderTest();
app.setDialogBehaviour(SimpleGame.ALWAYS_SHOW_PROPS_DIALOG);
app.start();
}
protected void simpleInitGame()
{
Vector3f terrainscale = new Vector3f(5f, .25f, 5f);
RawHeightMap myMap = new RawHeightMap("test16bit.raw", 129, RawHeightMap.FORMAT_16BITLE, false);
TerrainPage myPage = new TerrainPage("terrain", 33, myMap.getSize(), terrainscale, myMap.getHeightMap(), false);
myPage.setDetailTexture(1,16);
rootNode.attachChild(myPage);
rootNode.updateGeometricState(0.0f, true);
}
}
here is 8-bit in game
here is 16-bit in game
What could be causing this? If you'd like a copy of the heightmap, PM me and I'll email it to you.
*PS what does the "33" mean on the terrainPage? I just copied that from TestIsland*