I am trying to create a super simple scene of the Ninja.mesh.xml
model (that ships with the test-data
jar) to display front-and-centered against black background.
When I run the following:
public class Simulator extends SimpleApplication {
private Node avatar;
// Constructor, getter & setter, etc.
public static void main(String[] args) {
Simulator simulator = new Simulator();
simulator.setShowSettings(false);
AppSettings settings = new AppSettings(true);
settings.put("Width", 1280);
settings.put("Height", 720);
settings.put("Title", "My awesome Game");
settings.put("VSync", true)
settings.put("Samples", 4);
simulator.setSettings(settings);
simulator.start();
}
@Override
void simpleInitApp() {
viewPort.setBackgroundColor(ColorRGBA.LightGray);
DirectionalLight directionalLight = new DirectionalLight();
rootNode.addLight(directionalLight);
avatar = (Node)assetManager.loadModel("models/Ninja.mesh.xml");
avatar.localScale = 0.025f
rootNode.attachChild(avatar);
}
}
I get the following:
What is going on and what do I need to do so that the ninja model is centered on screen (against a black backdrop)?