Hello,
I'va come accross a problem I cannot solve for several days
I'm loading several models using ogreloader from radakan project.
Textures load fine, animations load fine but there seem to be a problem with meshes.
They do not fit the models I've prepared. Some of them are too large or too small.
I've prepared them in a way that their bounding box should be 1x1x1.
I'm using Jme 2.0 and the lates release of ogreloader.
I've checked the scale, rotation and translation of the spatial I'm loading and they're fine.
This is the method I'm using to load the models.
private Spatial loadSpatialFromOgre(String spatialName) {
OgreLoader meshLoader=new OgreLoader();
MaterialLoader matLoader = new MaterialLoader();
Spatial result=null;
try {
URL matURL = DataManager.class.getClassLoader().getResource(dataBaseDirectory+spatialName+".material");
URL meshURL = DataManager.class.getClassLoader().getResource(dataBaseDirectory+spatialName+".mesh.xml");
if(meshURL==null) {
System.out.println("Cannot find the model: "+spatialName);
return null;
}
if (matURL != null){
matLoader.load(matURL.openStream());
if (matLoader.getMaterials().size() > 0)
meshLoader.setMaterials(matLoader.getMaterials());
}
result = meshLoader.loadModel(meshURL).getChild(0);
}
catch(IOException e) {
e.printStackTrace();
}
return result;
}
I came through the loading process using debugger but I couldn't find what is the problem.
When I use jme obj loader, all the models are fine though.
Does anyone have an idea what can be wrong ?