Hello!
I made a model using DeleD and exported it using Collada Exporter plugin version 2.01.
I can't see nothing on my screen. Also I got that error:
5.06.2009 13:34:18 com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: system.bmp
5.06.2009 13:34:18 com.jmex.model.collada.ColladaImporter loadTexture
WARNING: Invalid or missing texture: "system.bmp"
The system.bmp is in the same folder with the plapla.dae model.
ColladaLoader.java:
package engine;
import java.io.InputStream;
import com.jme.scene.Node;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import com.jmex.model.collada.ColladaImporter;
public class ColladaLoader{
public static Node GetModelFromLocation(String Location) {
InputStream s;
try {
s = new FileInputStream(Location);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
ColladaImporter.load(s,Location);
Node model = ColladaImporter.getModel();
return model;
}
}
And initgame():
protected void initGame() {
scene = new Node("Scene graph node");
Node Tile = ColladaLoader.GetModelFromLocation("tiles/plapla.dae");
Tile.setLocalTranslation(new Vector3f(2,0,0));
Tile.setModelBound(new BoundingBox());
Tile.updateModelBound();
scene.attachChild(Tile);
BuildLight();
scene.updateGeometricState(0.0f, true);
scene.updateRenderState();
}
How I fixed:
DeleD collada exporter plugin didn't export my model correctly.. So I exported it as an obj file and later with meshlab to collada.
Also I added that code to fix texturing:
try {
ResourceLocatorTool.addResourceLocator(
ResourceLocatorTool.TYPE_TEXTURE,
new SimpleResourceLocator(setup.class.getResource("/tiles/")));
} catch (URISyntaxException e) {
e.printStackTrace();
}