First you can try tex_coord_set 0 in the file, it should refer to a set of UV coordinates…
mapping coordinates are in the mesh.xml file (you can look into it you should find them)
kidneytrader said:
How do you do it? Do you edit the material file manually, or is there another way?
In this post i explained how you could export J3o files with ogre exporter
http://www.jmonkeyengine.com/forum/index.php?topic=13635.0
But...to be honest, most of the time it is quicker to do manually.
If you use JME3 you can do it many ways
1. Use existing material definitions
Spatial treeModel=assetManager.loadModel("path/to/your/model");
Material treeMaterial = new Material(assetManager, "Commmon/MatDefs/Misc/ColoredTextured.j3md");
treeMaterial.setTexture("m_ColorMap", assetManager.loadTexture("path/to/your/tree/texture.png"));
treeModel.setMaterial(treeMaterial);
2.Make your own material file using material definition :
create a j3m file like that :
Material Tree : Common/MatDefs/Light/ColoredTextured.j3md {
MaterialParameters {
m_ColorMap: path/to/your/tree/texture.png
}
}
and in the SimpleInit
Spatial treeModel=assetManager.loadModel("path/to/your/model");
treeModel.setMaterial(assetManager.loadMaterial("pass/to/your/material.j3m"));
3.Embed it in the J3o file
- create the j3m file like in previous step
- double click on your mesh.xml file, this should generate a J3o file.
- right click on it and click on "Edit in scene composer",you should see your tree (all red like your first screenshot) in the model View.
- in the bottom left corner in the scene Explorer window, you should see the geom objects of the file (basicaly, your tree geom)
- Click on it and in the properties window (top right corner), you should see the properties of it
- In those properties there is a "Material" property associated with a list box, your material should be in it, choose it.
If every things went right you should see in the model view your tree properly textured (make sure the light is on by clicking on the bulb icon in the top right corner of the model view window).
Click on the save button in the scene composer window and your done. (don't forget that step!!)
Just load your model in the simpleInit (the J3o file) and it should be like in the model view.
I'm not familiar with texturing, actually I don't even know how to apply a defuse texture. But hopefully this will help?
Actualy you do...because you did it on this model :p
The diffuse map is the color or texture map...
just give up the Scene.material file, you don't need it anymore