I created a terrain in the SDK and painted three different textures on it. What I know is, that you can also use an alpha map to “set” the locations of the textures, but since I create my terrain in the SDK, I don’t need to set this alpha map texture.
I want to know where I painted which texture, in order to play a specific footstep sound when the player walks over that area.
I found this sentence in the wiki:
You can paint textures on the terrain and the plugin saves the resulting splat textures as alphamap(s).
So I tried the following
// result is a ray cast result (tile of terrain) TerrainQuad quad = (TerrainQuad) result.getGeometry().getParent(); Material mat = quad.getMaterial(); System.out.println("Mat: " + mat); // Mat: Material[name=null, def=Terrain Lighting, tech=Default] System.out.println(mat.getTextureParam("Alpha")); // null
I think I misunderstood something here! Where is the information saved where each texture is painted on the terrain and how can I access it?
Thanks in advance,
Okay, I got one step further: I did a stupid mistake, I get the alpha map via
The problem I have no is how to get the correct color depending on the player position. If someone did this already, I would be really happy when that person can share it with me. Else I will do my best and find a solution …