Hi,
I've been trying to create a simple terrain with a single tiled texture, to get a feeling for how it works. Unfortunately all I've managed is to have the texture stretched over the whole terrain. Any suggestions where I'm going wrong? Cheers!
MidPointHeightMap groundMap = new MidPointHeightMap(128, 1.8f);
groundMap.load();
mGround = new TerrainBlock("Terrain", groundMap.getSize(), new Vector3f(5, 0.75f, 5),
groundMap.getHeightMap(), new Vector3f(10f, 10f, 10f),
false, groundMap.getSize(), new Vector2f(0, 0), 1);
TextureState ts = display.getRenderer().createTextureState();
ts.setEnabled(true);
Texture t1 = TextureManager.loadTexture("/Users/graham/code/data/textures/GreenTile.png",
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);
t1.setStoreTexture(true);
ts.setTexture(t1, 0);
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);
t1.setWrap(Texture.WM_WRAP_S_WRAP_T);
rootNode.setRenderState(ts);
rootNode.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
rootNode.attachChild(mGround);