Cannot load model


I’m pretty new to nifty and I think I’m missing something obvious. I try to set up a GUI. It contains a button called view, when I’m clicking on it a model should appear.

I’ve got two classes. The first one is the Main , it sets up the GUI:
[java]public class Main extends SimpleApplication implements ScreenController {
Nifty nifty;
Screen screen;

public void bind(Nifty nifty, Screen screen) {
	 this.nifty = nifty;
	 this.screen = screen;


public void onEndScreen() {
	// TODO Auto-generated method stub


public void onStartScreen() {
	// TODO Auto-generated method stub


public void simpleInitApp() {
	NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
			inputManager, audioRenderer, guiViewPort);
	//Create a new NiftyGUI object */
	Nifty nifty = niftyDisplay.getNifty();
	//Read your XML and initialize your custom ScreenController
	nifty.fromXml("Interface/screen.xml", "start", this);
	// attach the Nifty display to the gui view port as a processor
	// disable the fly cam

public void showAnim(String nextScreen) {
	System.out.println("Changing Screen");
	Mesh mesh = new Mesh(this);
public static void main(String[] args) {
	Main main = new Main();


the second class, should be able load the mesh and to animate it later on, right now I’m just trying to load it.
[java]public class Mesh {
protected Main app;

public Mesh (Main app){ = app;

public void readingOgreMesh(AssetManager as, Node rootNode) {
	System.out.println("In the function");
	// Reading Mesh from File
	Node face = (Node) as.loadModel("Models/denz.mesh.xml");
	System.out.println("Did it");
	// Keep Offset to camera
	face.setLocalTranslation(0f, 0f, -60f);
	System.out.println("Try attaching child");

public void startAnim(String nextScreen){
	AssetManager as = app.getAssetManager();
	Node node = app.getRootNode();
	readingOgreMesh(as, node);


My screen.xml looks like this

Right now JME is only showing a black screen, when clicking on the View-Button. What am I doing wrong?
Thank you in advance!

How stupid! I’m sorry! I forgot to turn on the lights!

1 Like