I'm trying to load the .raw height map file from TestIsland.java, but I always get this strange error:
com.jme.system.JmeException: Must supply valid resource and size (> 0)
The code I'm using is exactly the same as TestIsland.java:
RawHeightMap heightMap = new RawHeightMap(Main.class
.getClassLoader().getResource(
"heights.raw"),
129, RawHeightMap.FORMAT_16BITLE, false);
Vector3f terrainScale = new Vector3f(5, 0.003f, 6);
heightMap.setHeightScale(0.001f);
TerrainPage page = new TerrainPage("Terrain", 33, heightMap.getSize(),
terrainScale, heightMap.getHeightMap());
rootNode.attachChild(page);
I don't know why that's happening! Help please?