I’ve made a test scene in blender using 2D planes. I’ve been following the wiki guide to importing models from Blender.
The scene loads without issue however, when I run the application there are thin gaps between the planes (horizontally not vertically) and after re-checking the dimensions and positioning of the 2D planes, I can’t work out why these gaps are appearing.
When viewed in Blender and in JME3 Scene Viewer, there are not gaps - they only appear when I run the application.
Can anyone clarify what I am doing wrong here please.
Screenshots below.
Viewed when run
Viewed in Blender
Viewed In JME3 Scene Explorer
And code…
public class Main extends SimpleApplication {
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
Spatial level = assetManager.loadModel("Models/textured planes.j3o");
rootNode.attachChild(level);
// sunset light
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f,-0.7f,1).normalizeLocal());
dl.setColor(new ColorRGBA(0.44f, 0.30f, 0.20f, 1.0f));
rootNode.addLight(dl);
// skylight
dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.6f,-1,-0.6f).normalizeLocal());
dl.setColor(new ColorRGBA(0.10f, 0.22f, 0.44f, 1.0f));
rootNode.addLight(dl);
// white ambient light
dl = new DirectionalLight();
dl.setDirection(new Vector3f(1, -0.5f,-0.1f).normalizeLocal());
dl.setColor(new ColorRGBA(0.80f, 0.70f, 0.80f, 1.0f));
rootNode.addLight(dl);
}
@Override
public void simpleUpdate(float tpf) {
//TODO: add update code
}
@Override
public void simpleRender(RenderManager rm) {
//TODO: add render code
}
}
A side issue is how best to organise the scene graph?
I’ve been using empty nodes in Blender to create a Level, Room, Floor and Ceiling Spatials in JME3 after the blend file is converted into a j3o file. This seems to work fine as shown in the Scene Explorer window but I haven’t tried accessing the spatials using code yet. Should I be using Groups in Blender to create the scene graph hierarchy or can I continue using empty nodes in Blender?