Sure, no problem. It's mostly stuff from the flagrush tuts. I only added the hex detail texture and replaced the MidpointHeightMap with a RawImageMap done in photosop.
Here the code
private void buildTerrain() {
// Generate a random terrain data
// MidPointHeightMap heightMap = new MidPointHeightMap(64, 1f);
// FaultFractalHeightMap heightMap = new FaultFractalHeightMap(64, 100, 1,100, 0.9f );
// FluidSimHeightMap heightMap = new FluidSimHeightMap(64, 100 );
// ParticleDepositionHeightMap heightMap = new ParticleDepositionHeightMap(64, 50, 1, 50, 100, 0.4f );
RawHeightMap heightMap = new RawHeightMap("media/images/heighmap1.raw", 256 );
// Scale the data
Vector3f terrainScale = new Vector3f(0.5f, 0.5f, 0.28515625f);
// create a terrainblock
tb = new TerrainBlock( "Terrain", heightMap.getSize(), terrainScale,
heightMap.getHeightMap(), new Vector3f(0, 0, 0), false );
tb.setModelBound( new BoundingBox() );
tb.updateModelBound();
// generate a terrain texture with 3 textures
ProceduralTextureGenerator pt = new ProceduralTextureGenerator(heightMap);
pt.addTexture(new ImageIcon(TestGame.class.getClassLoader().getResource("jmetest/data/texture/grassb.png")), -128, 0, 128);
pt.addTexture(new ImageIcon(TestGame.class.getClassLoader().getResource("jmetest/data/texture/dirt.jpg")), 0, 128, 255);
pt.addTexture(new ImageIcon(TestGame.class.getClassLoader().getResource("jmetest/data/texture/highest.jpg")), 128, 255, 384);
pt.createTexture(32);
// assign the texture to the terrain
ts = display.getRenderer().createTextureState();
Texture t1 = TextureManager.loadTexture(pt.getImageIcon().getImage(),
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR, true);
t1.setApply(Texture.AM_COMBINE);
t1.setCombineFuncRGB(Texture.ACF_MODULATE);
t1.setCombineSrc0RGB(Texture.ACS_TEXTURE);
t1.setCombineOp0RGB(Texture.ACO_SRC_COLOR);
t1.setCombineSrc1RGB(Texture.ACS_PRIMARY_COLOR);
t1.setCombineOp1RGB(Texture.ACO_SRC_COLOR);
t1.setCombineScaleRGB(1.0f);
ts.setTexture(t1, 0);
Texture t2 = TextureManager.loadTexture( TestGame.class.getClassLoader().getResource( "jmetest/data/texture/Detail.jpg" ),
Texture.MM_LINEAR_LINEAR,
Texture.FM_LINEAR );
t2.setWrap(Texture.WM_WRAP_S_WRAP_T);
t2.setApply(Texture.AM_COMBINE);
t2.setCombineFuncRGB(Texture.ACF_ADD_SIGNED);
t2.setCombineSrc0RGB(Texture.ACS_TEXTURE);
t2.setCombineOp0RGB(Texture.ACO_SRC_COLOR);
t2.setCombineSrc1RGB(Texture.ACS_PREVIOUS);
t2.setCombineOp1RGB(Texture.ACO_SRC_COLOR);
t2.setCombineScaleRGB(1.0f);
Texture t3 = TextureManager.loadTexture( TestGame.class.getClassLoader().getResource( "media/images/hex.jpg" ),
Texture.MM_LINEAR_LINEAR,
Texture.FM_LINEAR );
t3.setWrap(Texture.WM_WRAP_S_WRAP_T);
t3.setApply(Texture.AM_COMBINE);
t3.setCombineFuncRGB(Texture.ACF_ADD_SIGNED);
t3.setCombineSrc0RGB(Texture.ACS_TEXTURE);
t3.setCombineOp0RGB(Texture.ACO_SRC_COLOR);
t3.setCombineSrc1RGB(Texture.ACS_PREVIOUS);
t3.setCombineOp1RGB(Texture.ACO_SRC_COLOR);
t3.setCombineScaleRGB(1.0f);
ts.setTexture(t2, 1);
ts.setTexture(t3, 2);
tb.setDetailTexture(1, 16);
tb.setDetailTexture(2, 16);
tb.setRenderState( ts );
tb.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
scene.attachChild( tb );
}
And this is the image
Regards
--kaspaxl