Trouble loading 3ds model file

Hi, I am feverishly preparing materials for a WPI course using jME which I am teaching starting next week.  The problem I am having concerns loading a free 3ds model I found on the web.  The 3ds version of the model can be found at http://www.cs.wpi.edu/~rich/courses/imgd4000/homework/chess3d/chess.3ds.



I converted it using MaxToJME and loaded it using BinaryImporter, as per the instructions at http://www.jmonkeyengine.com/wiki/doku.php?id=model_loading.  The converted version can be found at http://www.cs.wpi.edu/~rich/courses/imgd4000/homework/chess3d/chess.jme .



However, when I render the model in jME it looks all messed up, with the pieces different sizes and bad locations, see http://www.cs.wpi.edu/~rich/courses/imgd4000/homework/chess3d/jME.jpg .



However, when I load the original 3ds model into a modeling tool, such as Cheetah, it looks fine, see http://www.cs.wpi.edu/~rich/courses/imgd4000/homework/chess3d.jpg .



Advice greatly appreciated,



Thanks, -Chuck

not really sure with 3ds format, but it could be that when u export the max file into 3ds file, u didnt bake transform.



try baking the transform of all objects and c what happens.



another thing here, if the chess pieces r movable, each one of them should be loaded seperately intead of loading everything all from 1 3ds file.



what i would suggest is export the board and each piece as a seperate 3ds file. then load them seperately and place them in the engine. afterall, u need to attach ur piece model to a class extends node that has somesort of movement methods.

Hi Yi, Thanks for the quick response, but I am afraid I am not quite helped enough yet:



(1) I don't know what you mean by "bake"?  Is this something I am supposed to do in 3DMax?  (I don't have copy on this machine—I was assuming that the distributed 3ds file is good—it looks good in Cheetah?).  Or is "bake" something to be done in jME?  (It doesn't say anything about this in documentation of MaxToJME).



(2) I don't see why I need to fuss with loading the pieces separately to move them.  The model has separate objects for each piece, which become children of the root node of the loaded model (I checked).  Can't I just transform the location of a subnode to move a piece?  (My piece class can have a pointer to the appropriate subnode).



-CR

not a problem~



first, bake is what u do in 3dmax or maya. and usually the free models u find online wont be good enough to be used directly, at least thats my experience when i was testing my code with free 3d assets.



second, yes, basic moving is fine of course. but what im saying is that each piece should have its own moving rules, points value for AI or scores, and some other functinalities, animations even, so thats y i suggested loading them seperately into ur own custom classes so u can do whatever u want to them. whatever provided by jme is just the tool to be used, usually not the ones a game actually needs and i think thats one of the best things about jme. u have all u need to build a castle, but u can still build a little tent with it in no time. theres no limitation to whatever u want to acheive.

You could try opening it up in Blender (it's free) and then exporting as obj, this is the format I had the most success with.

Thanks for the Blender tip.  However, the plot just thickens (blender joke? :).  When I load the 3ds model into Blender and render it, it is badly screwed up (pieces in wrong size and positions), but in a different way then when it renders in jME. 



Note that when I load the model into a demo version of Cheetah (nice Mac modeling tool), it renders just fine!  I suppose the next step would be to try to bake it in Cheetah and then re-export it (e.g., in .obj) format, but the demo version doesn't allowing saving scences (it's $130 to buy—not ready right now).



(I tried to load it into the Personal Learning Edition of Maya 8.5 (with the Bonus Tools from Area), but the advertised 3ds importer plugin does not seem to exist.)



As you can see, I am accumulating a nice collection of modeling tools! (And as should be evident, I am not experienced with modeling tools.)



I guess I am also concluding that I was a bit naive (?) about the ease of using free 3D assets?



Advice appreciated, -CR

Just because Cheetah beta can load it doesn't mean the model is fine… you should blame the model before you blame blender and jME.

I had many times where a model looked nice in the screenshot etc, when I load it, it has lots of T-sections, messed up normals, trash geometry inside it, etc. You may have to fix it up to get it to work.

Thanks for the advice.  In your experience, if I pay for a model, am I liable to get better quality???  I really don't want to have to fool around with it, as it is just for a class homework assignment (I'm the prof, not the student :).



Btw, it didn't just load in Cheetah, it rendered correctly.  (Though I hear from others that 'baking' is an issue, for scale, not just textures and lighting—I need to find a model/tool combination that can do this for me on short notice.)



-CR

Our tech artist says to make sure in max to go to the Utilites panel and click on reset xform and then click on Collapse.  That should fix it.



Not a lot of help though I suppose if you don't have max.  (Isn't there a free version?)

I would simply suggest using different models, why not trying to find some simple OBJs, or better yet… create your pieces programatically, that way you would have complete control over them…



I created a Solid of Revolution utility class a while ago that you could use to create every piece in your example, except for the horse!



If you are interested: http://www.jmonkeyengine.com/jmeforum/index.php?topic=5768.0

i exported the 3ds into obj and everything is fine. ill send u the file and code right now.

In your experience, if I *pay* for a model, am I liable to get better quality???

I am not sure, as I never bought any models. (There's so many free models online, why pay?)
I am not really sure if you're looking for 'quality', more like fitness in a real time 3D game instead of just renders in a particular modeling tool.
In my expirience the model as you see it in the modeling tool will not always look the same in-game.

Not a lot of help though I suppose if you don't have max.  (Isn't there a free version?)

Yes, it's called GMAX, though I don't remember if it supports the 3ds format.

If you don't get this model to work, you can always get a different model, the jME resources wiki contains many links to free resources.
I did a search on one of the sites for the word "chess" and I found many models that look like the one in your screenshot.

For those of you who are waiting with baited breath for the end of the story:



(1) Reset Transforms was indeed the solution to the basic scaling problem.  (You don't want to Collapse, however, since moves everything to center)



(2) It was then clear that the model had been made with reversed (inward facing) normals in various places, which made random parts of it transparent (ugly but usable).  That's what you get for free (non-professional work).  Doesn't affect renderering in modeling tool, but does with OpenGL in jME.



(3) Now that I have access to 3DStudio, I can convert .max files to .3ds for reading into jME, which opens up a much larger universe of free chess models :), which we are now exploring for one in which the normals are correct.



Thanks to all for your speedy and helpful advice,



-Chuck

It's good that you finally came to a solution  :slight_smile:


I can convert .max files to .3ds for reading into jME, which opens up a much larger universe of free chess models smiley, which we are now exploring for one in which the normals are correct.

There's a 1-button feature in all modeling tools that can recalculate normals, or flip them, in case you really want to use the model you have there.
charles.rich said:

(1) Reset Transforms was indeed the solution to the basic scaling problem.  (You don't want to Collapse, however, since moves everything to center)


Actually, you generally DO want your models to be collapsed to the origin (at least on a piece by piece basis), especially if you plan to independently move them.  Not having them as so means you'd have to account for an offset when you try to position your model piece in world coordinates.