Model from .obj file not loading properly

Hello,



when I load a model from an .obj file in the jme3 model viewer, it doesn’t show properly. The textures have a strange color(mostly white, some yellow parts) and certain parts of the model aren’t rendered in a certain perspective.

I created the .obj with Blender 2.49 . Can anyone help me?

I don’t know about the model loader, but I put some code in the Forum, Comunity, UserCode and Projects section that loads an exported .obj animation and plays it. Just make sure the model has a material, and has a texture image attached to its UV coords, then export the .obj to an asset folder and make sure the texture image is in the same folder. animating .obj files is the name of the post.

I now tested the model ingame. It is completely visible and the textures are there as it seems. The problem is that the renderer seems to “overpaint” it with a white color(not 100% opacity). I can see the pattern of the textures when I zoom in, it’s just extremely “whited”. The .mtl file is there, same name as the .obj file. Also from certain distances/angles the renderer completely overpaints it with a black color.



The meshes are there, it’s just that the textures are being incorrectly rendered. I tried to open it in a different program which supports .obj and it rendered it fine. This is a static model I have here, no animations.

May I ask what export options you choose in the exporter when exporting it in blender 2.49?

Selection only, animation, rotate, materials, UVs, Normals, HQ, polygroups, keep vert order. I have only run the animation out of the game window not the scene viewer. Have you checked the specularity shader… might the model just be really shiny?

The specularity shader’s intensity is on 0. The game window renders it the same way as the scene viewer.

When I export as ogre, it is completely black in JME. What is wrong?

Try generating tangents for the models meshes with TangentBinormalGenerator or with the jMP SceneComposer.

I got the textures rendered now in the .obj files. Still, the model is black from certain viewpoints. The viewpoints which let the model appear black are all from a top view. When I look at the models from below, they’re rendered fine.



How do I generate tangents in jMP?

As Normen says there is 2 ways

in your code



TangentBinormalGenerator.generate(yourMeshorYourSpatial);





or you convert your model to j3o in JMP (right click / generate j3o …or something like that), and you check generate tangent and bi normals.

Then you load the j3o file in your code.



The latter is better IMO, since it’s done once and for all.

Got it to work, thanks.

Apparently it was an issue with Blender 2.5 .

myamo said:
Got it to work, thanks.
Apparently it was an issue with Blender 2.5 .

If you could go into a little bit more detail about what exactly the issue was, it will be easier for other people who have this problem in the future to locate this thread to help them in their problem solving. It's nice way of adding to the value to the free help you're receiving :)

I created the first model with Blender 2.5(because I like the 2.5 user interface better) and exported it with Blender 2.49. It was bugged.

When I created it with 2.49 and exported it with 2.49 it showed fine in jME.



So apparently Blender 2.5 is not ready yet.