Hi, guys. I was practicing with JME3 and did a small model in blender like this, with a camera and some lights:
http://www.freeimagehosting.net/ea081
Just the default cube with a texture and a plane as a floor (both UV mapped). I exported as a OGRE3D files and it gives me cube.scene, Material.001 (I checked it , and it refers only to the texture of the floor but not the one of the box) , and plane.mesh. I tried putting inside a zip file called scene and loaded like with town.zip (calling cube.scene), but it fails.
[java]package mygame;
import com.jme3.app.SimpleApplication;
import com.jme3.asset.plugins.ZipLocator;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Spatial;
/**
- test
-
@author normenhansen
*/
public class Main extends SimpleApplication {
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
assetManager.registerLocator(“scene.zip”, ZipLocator.class.getName());
Spatial scene = assetManager.loadModel(“cube.main”);
rootNode.attachChild(scene);
}
@Override
public void simpleUpdate(float tpf) {
//TODO: add update code
}
@Override
public void simpleRender(RenderManager rm) {
//TODO: add render code
}
}
[/java]
I tried loading putting them in the different assets folders, but when trying to view the scene in the SceneComposer JME3 asks for the textures to be in the same folder as as the mesh and having the same name. Doing so it only shows me the floor properly textured and lit, but no trace of the box, and mesh.xml produces an untextured red plane (¿?).
I know I’m doing something wrong and there is and obvious solution (there cannot be more than one separated mesh in a scene?), but I tried searching in the forums and the documentation, and nothing. I think the “hello asset” tutorial fails a bit on explaining how to load your own models properly and the uses of the default folders (what is exactly the difference between the materials folder, the textures folder, and the scene folder or the model folder?) and the blender exporter guide should be updated. That’s what i am asking. How can I load them properly? How to use the folders so I can have the game project organized?. Should all assets be referenced separately through code (i.e load (“models/maincharacter.xml”) and load(“textures/maincharacter.jpg”)), or just load one (the mesh) and all is implicitly referenced? Is it better to use zip files?
Thanks in advance, I know the question is a bit wide, but I tried a few days myself in the solution and I cannot figure it out. Regards.