Clodmesh and obj object

Hi everyone !



I want to manage the precision so I tried that :



>> Charge the building model


ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE, new SimpleResourceLocator(WorldGameState.class.getClassLoader().getResource("edu/poly/idmi/betaville/data/models/rogershall/")));

ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_MODEL, new SimpleResourceLocator(WorldGameState.class.getClassLoader().getResource("edu/poly/idmi/betaville/data/models/rogershall/")));

URL wunsch = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MODEL, "rogershall1.obj");

// Create something to convert .obj format to .jme
FormatConverter converter = new ObjToJme();
// Point the converter to where it will find the .mtl file from
converter.setProperty("mtllib", wunsch);
// This byte array will hold my .jme file
ByteArrayOutputStream BO = new ByteArrayOutputStream();
try {
// Use the format converter to convert .obj to .jme
converter.convert(wunsch.openStream(), BO);
// Load the binary .jme format into a scene graph
Node building = (Node) BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));

buildingNode = getClodNodeFromParent((Node) building);
buildingNode.setLocalScale(25);

//Attach the clod mesh at the origin.
buildingNode.setLocalScale(.1f);
rootNode.attachChild(buildingNode);
[...]

>> Create the clodmesh
private Node getClodNodeFromParent(Node meshParent) {
// Create a node to hold my cLOD mesh objects
Node clodNode = new Node("Clod node");
// For each mesh in maggie
for (int i = 0; i < meshParent.getQuantity(); i++) {
final Spatial child = meshParent.getChild(i);
if (child instanceof Node) {
clodNode.attachChild(getClodNodeFromParent((Node) child));
} else if (child instanceof TriMesh) {
// Create an AreaClodMesh for that mesh. Let it compute records
// automatically
LOGGER.info("ehio
" + child.toString());
AreaClodMesh acm = new AreaClodMesh("part" + i,
(TriMesh) child, null);
acm.setModelBound(new BoundingSphere());
acm.updateModelBound();

// Allow 1/2 of a triangle in every pixel on the screen in the
// bounds.
acm.setTrisPerPixel(.5f);

// Force a move of 2 units before updating the mesh geometry
acm.setDistanceTolerance(2);

// Give the clodMesh node the material state that the original
// had.
acm.setRenderState(child
.getRenderState(RenderState.StateType.Material));

// Attach clod node.
clodNode.attachChild(acm);

acm.setCullHint(Spatial.CullHint.Dynamic);
} else {
LOGGER.warning("Unhandled Spatial type: " + child.getClass());
}
}
return clodNode;
}

When I run it, the geometry is disformed and I cannot get the texture.

Is someone can help ?