Problem with loading model from ogre

Hello,



I'va come accross a problem I cannot solve for several days :frowning:

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 ?

hmm does the models in the repo that are given work properly for you & i'm unsure if it matters or not but i returned it a Node not a spatial?

The models from repository work fine.

And it doesn't matter if I use the node returned by ogreloader or spatial fetched from it. The result is the same.



I use the latest ogre mesh exporter for blender. My blender is 2.48a.

I'm also almost sure that it exported the data well. Although I'll check it again, maybe I missed something.