Hi all
So I built a model in blender, but adding a texture doesn’t seem to work. When I used a heightmap it worked fine but not on the spatial that the blender model is.
The texture is tiny and is this:
It should look like a red grid on white. But, ts just all red:
The odd thing is if I use a different texture the colour is different - like this texture gives me a tan colour!
i
Any ideas? This is my code:
public GameEnvironment(AssetManager assetManager, BulletAppState bulletAppState) {
mat_terrain = new Material(assetManager, "Common/MatDefs/Terrain/Terrain.j3md");
mat_terrain.setTexture("Alpha", assetManager.loadTexture("Textures/alphamap.png"));
/**
* Add grid texture into the blue layer (Tex3)
*/
Texture surfaceTexture = assetManager.loadTexture("Textures/grid8.png");
surfaceTexture.setWrap(Texture.WrapMode.Repeat);
mat_terrain.setTexture("Tex3", surfaceTexture);
mat_terrain.setFloat("Tex3Scale", 2048f);
Spatial terrain = assetManager.loadModel("Scenes/untitled.blend");
terrain.setMaterial(mat_terrain);
environment.attachChild(terrain);
/* make terrain solid */
CollisionShape sceneShape = CollisionShapeFactory.createMeshShape(environment);
landscape = new RigidBodyControl(sceneShape, 0);
environment.addControl(landscape);
bulletAppState.getPhysicsSpace().add(landscape);
}