Import Obj

Hi everyone,

I’ve some troubles with Obj importer. Some texture are not right imported or build, and the geometry is not 100% correct.

I’m a begginer.

This is my code :

    try{
       Spatial myModel = assetManager.loadModel("Models/Serra/Serra.obj");
       myModel.scale(0.09f);
       rootNode.attachChild(myModel);
       DirectionalLight sun = new DirectionalLight();
       sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());
       rootNode.addLight(sun);
    }
    catch(Exception e)
    { 
       System.out.println("Brocken");
    }

Give that :

Help please :frowning:

Thx you !

Ps : Some people say to me “take ogre.xml, so better on jme3” that is right? I didn’t found on the web how to load it on jme3 :slight_smile:

Well obj works fine for static models,

-> but contains no tangent binominals
-> keep in mind saved colors of objects, that are not necessarly visible in modeling programms (eg ambient color)
-> geometry errors might happen if you have invalid/ambigious parts in the model, often caused be inverted normals, or faces that you need back and front, without face culling.

I hope this gave you some ideas to search further.

Ok thx, I’ve seen some ambigious parts in my model. I will try with a big static models “obj” and see after. Thx you :slight_smile:

mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.
mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.
mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.
mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.
mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.
mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.
mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.
mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.
mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.

x1xx…

So I think that it was the third solution, right?

Hi again, I’ve tried my import with an object from the official website of Google Sketchup, and I’ve just one thing who is missing :

and give me that on jme3 :

I’ve put the cooker hood in blue so all the same materials is blue (I hope you understand my bad english)

Why my face deseppear?

Thx you :frowning:

Ps : I’ve again this avertissement x4 : mai 27, 2014 3:04:11 PM com.jme3.scene.plugins.OBJLoader readFace
Avertissement: Edge or polygon detected in OBJ. Ignored.

Triangulate the model before exporting it.

I’m using Sketchup, how I must triangulate this? handmade?

http://bit.ly/1tms9gA