How to properly load assets (obj) in jme3 using Eclipse? (beginner’s question)

Hello there. I have just started using the jme3 framework and learning the basic stuff so please bear with me. I have read the official tutorial about loading the ‘assets’ and created the source folder of the same name in my project root directory. I also managed to load model, but it kinda doesn’t look like I expected it would be:







And the code I came up with looks like this:



[java]/**

  • @param args

    */

    public static void main(String[] args) {

    GameInit game = new GameInit();

    game.start();



    }



    @Override

    public void simpleInitApp() {



    Node pivot = new Node("pivot");

    rootNode.attachChild(pivot);



    Spatial figure = assetManager.loadModel("Models/figure.obj");

    Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");

    mat.setColor("m_Color", ColorRGBA.Red);

    figure.setMaterial(mat);



    pivot.attachChild(figure);

    pivot.rotate( 0.4f , 0.4f , 0.0f );

    rootNode.attachChild(pivot);





    // You must add a light to make the model visible

    DirectionalLight sun = new DirectionalLight();

    sun.setDirection(new Vector3f(1f, 2f, 3f));

    rootNode.addLight(sun);





    }[/java]



    Can someone please point me in the right direction with this? Thank you in advance!

You do it “properly”, I guess the model is not compatible, try using OgreXML instead.

Yup, it seems to work now - thank you normen for your help and my apologies for my noobism! :slight_smile: