[SOLVED] Textures added during runtime map incorrectly

When I add a texture in the material editor, the texture maps onto the model correctly. But when I add a texture during runtime, it does not map correctly on the model. What should I do to fix this?

Spatial model = assetManager.loadModel(carData.getString("model"));
Material mat = assetManager.loadMaterial(carData.getString("material"));
Texture tex = assetManager.loadTexture(carData.getString("texture"));
mat.setTexture("DiffuseMap", tex);
model.setMaterial(mat);

Without seeing what “incorrectly” means, I’m going to guess texture flip.

2 Likes

“Incorrectly” looks like a mess…

The cars are the jme ferrari model.

How do I flip the texture? Texture or Image don’t contain any obvious methods to do it… oh wait, found it, and that fixed the issue. Thanks!

1 Like