Importing 3d model into jme...........(need help !)

i have created a 3d model of house using google sketchup…i have saved my 3d model file called house.skp…



can anyone please tell me how to import skp file(models) into jme…

i want to render my 3d house model in the screen…

I guess it isn't possible to import the skp format.



Only the Pro Version of Google Sketchup supports some useful formats.

eg Collada (.dae)

( http://sketchup.google.com/support/bin/answer.py?hl=en&answer=36203 )

could u please suggest me some other free 3d modelling tools for creating models to which jme supports…

Well blender is the regular suggestion I guess. Check out this thread for an importer / exporter hevee created.



There are probably exporters for blender to get the model into other formats that jME supports - md5, obj, ogre xml etc. Also check out this paragraph in the wiki - i think it has more information that you might be interested of.

thanks for your reply…i downloaded the blender but it seems bit complicated to use as a beginner…

since i had to test the 3d model by rendering it to screen, so i downloaded some free 3d models…

and i downloaded 3 models which are in .max format…



so does jme supports max models…if so could you please tell me how to load it…

please if possible, give some url where i could read it…

You cannot import max models directly in to JME.



Max is probably the most inconvenient format there is. It is a proprietary format for 3D Studio, and it does not define models the way most formats might. As such, you cannot import max into JME, or really any other program except for 3DS Max itself. Unfortunately as 3D Studio is as close as you'll get to the standard tool for game modelling, there's a lot of stuff out there in this format.



I'd love to hear it if there's a better solution, but I think your only option if you want to use models in the max format is to download the 3d studio free trial, and convert them yourself to a useable format, such as .3ds



Alternatively, there's a good chance you'll find some free models already in the 3ds format, or another that you can use.

ok…so could you please tell me which is most suitable 3d model file to load into my jme app…

also please tell me where could i find the tutorial or code snippet to load 3d models…





i also wanted to know that doesn't jme have a api that can convert max or (non-supportable models) to some appropriate file type that jme can render ?..

Look in the jmetest package for examples of model loading. They are under jmetest.renderer.loader



Which is the most suitable depends on your requirements and is really a matter of opinion.

For static models there are several that should all work fine: .obj, .3ds (3d studio),ms3d (milkshape)

You may also want to search the forums for .MD5 and COLLADA which have advanced features.

All of these formats are well known, so it is possible to convert between them with many common 3D programs.


i also wanted to know that doesn't jme have a api that can convert max or (non-supportable models) to some appropriate file type that jme can render ?..........

To my knowledge, no such converter exists anywhere, it isn't just a jme thing. The max format is not published, and nobody has been able to decode it as far as I know. It stores data which is meaningless outside  of the application that created it, such as procedural mesh parameters.

thanks alric for your reply…



i have checked some samples in jmetest folder for rendering 3ds file…

i have downloaded one 3d model of a speaker(of music system) from the net…

and i coded the app to render it and it worked…i have rendered the model but there is a bit problem…



that is… in my model there are lights and shadows around the speaker…but when i render it, those lights and shadows doesn't appear…its all black around the my 3d model on the screen…only model gets rendered…



why is this happening? and should i use my own light source ?..if i use my own light source than what about the lights that was present in the 3d model ?..

The 3ds importer should be able to import lights, but they might not look the way they do in max because of different shading models to say the least.

Could you maybe post two small screenshots to illustrate how exactly the jME render differs from what you expect to see?

i have rendered a streetlight model which should look like this …but it isn’t getting rendered as original…









when i render this model only one streetlight gets rendered and there is no lights and shadows…

i have loaded  a lamp model also…lamp gets rendered without light and shadow…i am using 3ds model…

original lamp wal like this…



http://www.mr-cad.com/popup_image.php?pID=920&image=mr-lampfree2.jpg



can anyone tell me why lights and shadows are not visible or not getting rendered ?..



or do i have to use other file type rather than 3ds…

Luz said:

I guess it isn't possible to import the skp format.

Only the Pro Version of Google Sketchup supports some useful formats.
eg Collada (.dae)
( http://sketchup.google.com/support/bin/answer.py?hl=en&answer=36203 )


Actually, that isn't entirely true. Save your google sketchup model to the KMZ file, which is really nothing more than a zip file. Rename the kmz file to a zip, and there should be a .dae file in there you can then load up. More info can be found here:

http://update.multiverse.net/wiki/index.php/Creating_Static_Models_with_Google_SketchUp

It's not a jmonkey link mind you...but it will still produce a collada file ;)
padam said:

when i render this model only one streetlight gets rendered and there is no lights and shadows......

I assume that image was on the site you got the streetlight model from?
It is most probably just a demo scene, the 3ds model file doesn't contain the pavement, wireframe streetlight and second solid streetlight - and I'd guess it doesn't contain any lighting information either.
If you need your scene to look like that, you'll have to rebuild it, which shouldn't be too hard using only jME and your single streetlight model.
To get an idea how to start, just read the user guide and the tutorials on the wiki and browse through the source code in jmetest, which is the most important learning source for all jME features.

Also bear in mind that you won't get shadows by default in jme.

By shadows I mean proper shadows like in the second screenshot - you will get shading.



This is because unless you use a raytracing engine (which realtime engines generally aren't), then shadows aren't a natural part of the scene. They are more of a special effect, and can be quite a slow one. If you do need proper shadows then a forum search should turn up some info on how to get them in JME. There is also some example code in the jmetest package.