hi,
im new to jme and its my first time to build models in 3dsmax. And sorry about my oor english.
i built every thing as the scene (about 20 buildings) in 3ds max and exported the whole scene. however i cant import the model in jme2 both as xx.3ds and xx.obj. i think because my file is too big. more than 13,000 KB in obj format and more than 7,000 KB in 3ds.
then i export a single building(around 1,000). the obj importer and max impoter worked this time but the object has no texture. i noticed that when i export it as obj, no texture exported. the 3ds models all overlap together in jme2.
so my questions are: how to export/import big files. should i divide the scene and import each file one by one?
how to export obj with texture. will md5 or collade work better?
Thx in advance
hey there,
you should always use the jme binary format .jme for models because they load faster (by multitudes!) and to convert your models you can use the ModelLoader that is included in the jme(test?) source. Play around with that tool.
secondly, the multiple houses should be devided so that they are meshes on their own so culling works correctly. this can give you a LOT of performance back.
to achieve multiple meshes you can still export it as one model, since .obj is hierarchical too. or you can export the houses one by one and convert and load them or all together, both should work, just do what works best for you
thx, but how to export modles with texture.
it seems dull when i load my .obj into jme2, i want to convert a textured model into .jme
well, my artist uses 3dsmax too and the built in WAVEFRONT .obj exporter seems to work perfectly here, even with textures. The ModelLoader uses the ResourceLocatorTool to locate the textures.
i use 3dsmax 2009, and i found i can export with the colored matirial but not the picture matirial.
for example, the painted wall looks good, bur the brick matirial using a image cant be shown.
i think it is because im not familiar with 3dsmax.
did i miss some steps when i export ?
motionfly said:
did i miss some steps when i export ?
well, my artist uses an older version i think, but even then the exporter had a lot of things to configure, just be shure to check that a .mtl file is generated and that it contains the key map_Kd for each textured material. for example:
#
newmtl WallMtl
Ka 0.6 0.6 0.6
Kd 0.6 0.6 0.6
Ks 0.9 0.9 0.9
d 1.0
Ns 0.0
illum 2
map_Kd Wall.png
#
if not you have to play around with the exporter options or just add the textures in the .mtl file yourself ;)
i fix the export problem now.
i can export textured obj now
i found lots of people have the problem to export texture with 2009, then i tried the 3dsmax2010. Everything works well. i still cant export a good obj format model directly. So the solution is i first exprt the 3ds format, then import the 3ds format, again i export the model in obj format, the texture is on.
i export the one building each.
Next i will convert every building to .jme. then load everything as the scene.
my new question is should i load each building or , exort the whole scene in .jme.
do i need to retransform each buildings position.
motionfly said:
my new question is should i load each building or , exort the whole scene in .jme.
i would load each building seperately, might come in handy later (adding, removing buildings, ...)
motionfly said:
do i need to retransform each buildings position.
depends on how you export it, you'll just have to try and play around with it. :|
hi
i meet new problems, i checked there are some solutions, but i still cant fix it.
its the texture problem
the mtl looks like this
newmtl light_brick
Ns 1.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5843 0.5843 0.5843
Kd 0.5843 0.5843 0.5843
Ks 0.4941 0.4941 0.4941
Ke 0.0000 0.0000 0.0000
map_Ka -s 0.0208 0.0254 1.0000 LIGHT BR.png
map_Kd -s 0.0208 0.0254 1.0000 LIGHT BR.png
map_bump -bm 0.0000 -s 0.0208 0.0254 1.0000 LIGHT BR.png
where light br.png is the file name
I always meet FileNotFoundException:D:jmeworkspaceStartsJME-s 0.0208 0.0254 1.0000 LIGHT BR.png (The system cannot find the file specified)
the images are in the same directory with my model, no matter how i point the file path,like
URL objFile=TestObjJmeWrite.class.getClassLoader().getResource("export/ground.obj");
URL mtlFile = TestObjJmeWrite.class.getClassLoader().getResource("export/ground.mtl");
URL dir = TestObjJmeWrite.class.getClassLoader().getResource("export/");
converter.setProperty("mtllib", mtlFile);
converter.setProperty("texdir", dir);
or use ResourceLocatorTool, the result is the same. im wondering if it is the path problem or something wrong with my mtl or the name of the images
the only way i can fix the texture is to modify the model to unwrap in 3ds max. then export the model as obj or 3ds
the mtl is like
newmtl light_brick
Ns 1.0000
Ni 1.5000
d 1.0000
Tr 1.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.4980 0.4980 0.4980
Ke 0.0000 0.0000 0.0000
map_Ka LIGHT BR.JPG
map_Kd LIGHT BR.JPG
map_bump LIGHT BR.JPG
bump LIGHT BR.JPG
and when i load the .obj model back in jme, the texture seems good.
but the .3ds model still looks dull