简体   繁体   中英

jMonkeyEngine: importing .x models

I found this importer for .x files in the jMonkeyEngine SDK plugins: http://jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/directx-to-j3o-converter/?topic_page=1&num=15 , and I downloaded/installed it successfully via the Tools -> Plugins menu.

But I'm not sure how to use it. I tried adding a model to my assets folder, then right-clicking it in the SDK and choosing "Convert to j3o Binary", but this accomplished nothing: no dialogs popped up, and nothing seemed to change at all. My code still generates a runtime warning stating that it doesn't know how to load a .x file.

截图

PS I posted this question as a reply on the linked thread as well. So far, no responses, so that's why I'm posting here, but just a heads-up in case someone replies there in the near future.

Update: A user replied to the thread, suggesting I check to see if any errors are being thrown (a little red error icon in the bottom-right corner of the screen). Sure enough, there was, and the error message was the converter complaining about not being able to find the dwarf.jpg texture. So I moved the texture into the Models folder next to the dwarf1.x model.

However, the conversion process is still behaving the same way, except that the error icon doesn't come up. In other words, nothing appears to be happening now, and no error messages are being thrown. I don't see any .j3mo file having been created anywhere, and my code is still causing a runtime exception that complains about not having a loader for .x files. (Note: I saw the filename typo in my screenshot, "dwarf.x" instead of "dwarf1.x", and have since corrected it, so that is not related to the problem at all)

Ok, found out the problem. The converter was still not finding the texture, even though it had stopped reporting the error about it. I had to rename the texture to match the model's filename exactly (except for the extension, of course), so "dwarf.jpg" became "dwarf1.jpg". Note also that it has to be in the same exact folder: in my case, I put it in the project folder/assets/Models/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM