Invisible / White .obj Models

Hi,



I have created a game for my university project, and am adding in .obj models.



Now, they worked fine running the game in Jmonkey platform.



They didnt even add themselves to the compiled Jar file, and when I put them in manually, they appeared all white (no texture).



Since then, I have moved to eclipse with Jmonkey, where compiling works fine, but running in the platform or environment renders them invisible.

the only way to make them visible is to override the texture with something. (you can still interact with invisble one so it IS there).



How would I go about fixing this problem, as the model comes with different colours, and is ruined by overriding with one colour.



Thanks,

Paul

jMonkeyPlatform adds assets automatically to the jar, you don’t need to add them yourself. They get converted to the J3O format with proper texture paths. Just use the asset manager to load the j3o files instead of the OBJ and it should work

Sorry for the slow reply!



What you said sounds very logical!



The problem is that I cant find the J3o files in the assets.jar either.



Please let me know where I should be looking. Thanks,

Why don’t you just use jMonkeyPlatform, you don’t seem to know how Eclipse and classpaths work… What jMP does is create a jar form the assets folder and add it to the classpath of the distribution.

Yes, using the JMonkeyPlatform gives me white models… I am trying to use it now, but I dont know where the j3o files are located, that it creates.



[java] case 1: Spatial Ant = assetManager.loadModel("Models/Ant.obj"); critterNodes.attachChild(Ant); break; [/java]

You load an obj file, not a j3o file. So no wonder it cannot be found xD How did you create the j3o files? Normally you just need to double-click a model file and the j3o file will be created in the same directory. Both files have to be inside the “Project Assets” which is the “assets/” folder. This is the folder that the jar is created from, .obj .mesh.xml files etc. are excluded, only j3o files are kept in that file.

1 Like
normen said:
You load an obj file, not a j3o file. So no wonder it cannot be found xD How did you create the j3o files? Normally you just need to double-click a model file and the j3o file will be created in the same directory. Both files have to be inside the "Project Assets" which is the "assets/" folder. This is the folder that the jar is created from, .obj .mesh.xml files etc. are excluded, only j3o files are kept in that file.


/facepalm, I know im loading the obj file, because the j3o file doesnt exist. That was my question, on where it was located. I double clicked on it like you suggested and i3o now exists :D thanks!!!!

Im also aware that it uses the assets folder, im not a complete newb :P

I must be missing something…

[java] case 1: Spatial Ant = assetManager.loadModel("Models/Ant.j3o"); critterNodes.attachChild(Ant); break;

case 2: Spatial Bee = assetManager.loadModel("Models/Bee.obj"); critterNodes.attachChild(Bee);break;

[/java]

Using jmonkeyplatform run… the obj loads fine, but the j3o comes out white! like it did when I compliled it to .jar!!! There are no texture files I can find.

(ant is white, bee is coloured)

Note, that the .obj are created from 3dsmax, and also, there are no actual texture files, they are simply coloured using the 3ds max color pallette





Edit: maybe these j3odata files are of use?

Hey, they all still white, I have til tomorrow before I must demonstrate my game :frowning: