dotScene import

Can anyone point me to a tutorial that shows how to make something like the car in the FancyCar demo? I would like to load in a car model as a dotScene, however I can’t get my dotScenes to load, and when they finally do, the wheels aren’t in the right places and the material is all messed up.

What more of a tutorial can there be than the exact code that creates the car from a normal ogre model? :slight_smile: The SDK has a plugin that allows you to edit a j3o model as a vehicle and add wheels etc. visually, basically the same way the FancyCar example does it, by getting the center of the wheels etc. theres a manual entry about it too.

I’m sorry, you’re right about the jME code. It is correct. Exporting the model is where I think I’m having trouble. I’ve made a model in Blender, and exported it using the ogre mesh exporter and the dotscene exporter, but my wheels all spawn in the center of the vehicle and don’t respond to changes in their translation from the dotScene file, and the material is all wrong. I can’t figure out the problem.



Also, I’ve tried loading the assets one at a time into jMonkeyPlatform but I can’t seem to figure out how to get multiple models on the screengraph at once. I admit, I haven’t used the SDK much at all because it only works on my Mac, so I don’t know how to use it very well. I’ve been using Netbeans (and just recently Eclipse) for JME3 stuff on my Linux machine (whic crashes when i load shaders and stuff in jME3). The only guide I’ve found dealing with using it to using models is here: https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:model_loader_and_viewer I did the things on that page, but again, I couldn’t figure out how to get the body of the vehicle and the wheels to be displayed on the same screengraph at the same time. Maybe I’ve overlooked something. I’ll continue to look.

There u go. Before exporting dotScene(.scene), apply visual translation/rotation to each model in blender (ctrl+a). Tell me if it worked. Ah, and about the “

I’ve tried loading the assets one at a time into jMonkeyPlatform but I can’t seem to figure out how to get multiple models on the screengraph at once
” you will have to create a new empty scene file using the file wizard, right click and open it on SceneComposer, and add/link the car model and each wheel to that created scene. Don’t forget to add light so you can see the models.

Edit: About the material you’ll have to create .j3m materials using the material editor in jmp.

1 Like

Thanks for the advice, I’ll give that a shot today when I get the chance.

Here are some things I’ve tried:

I followed this tutorial until about the 5:20 mark and still had the same problems with the translations: http://www.youtube.com/watch?v=qrbCgXXdEh8&t=0m16s



As far as using jMEPlatform; I built a model using this method, but I can’t export the model for other programs to use. I’m running into every problem imaginable. Since the blender model used an image as a meterial on part of the model, I can’t use the j3o file in a straight netbeans project because the assetmanager crashes every time I try to load the j3o file because it can’t find that material image, no matter where i put it in my filesystem. This isn’t really a good option for me because the model needs to be designed and loaded by the user in a standard modelling format. (Unless I can somehow make my own j3o scene editor).

The assetManager tells you where it expects the image to be. Also, j3o is no interchange file format, it can be likened to a “compiled” application as opposed to source code. It depends on the given data structure for the project as the image is referenced by its path. You can use the j3o in another project though, you just have to make sure the assetManager of that project can access the image files at the correct location (e.g. register a locator to some assets folder or add the images to the class path while maintaining the folder structure). When you let the user load models from “somewhere” this is also the case, you should basically register the filesystem root with the asset manager then as registering each folder you want to load a model from will result in images with the same AssetKey (e.g. texture.jpg without any path) and the wrong images will be loaded. All this is also explained in the wiki and manual, you might want to read up on these issues. Your “own j3o scene editor” would have the same issues, so I don’t really know what you want to do in that you could not do in the SDK. For editing basic models and meshes theres 3d editors, for editing and saving jme3-specific scene data you will have to go the j3o way.

Thanks again for the info Norman. I will study up more on those things, I’m sorry that you have to keep telling me to RTM. I feel like when I read them, I’m just missing things.



Yes, the asset manager is telling me where to look for the texture, but it seems to be a relative filepath so I have to add both the j3o and the texture file to the project, with the apropriate filepaths registered with the asset manager.



In general, I think the dotScene will be the best for me, but I still can’t get my model to work. If anyone is interested in helping me figure that out, Here is a screenshot of the model in blender, with all the parts where they belong. This is how I exported it. The center model is all one piece and works as expected. The method I used to make and position the wheels is outlined in this video (up to about 5:20mins is where I stopped to export the models). Here is the result of importing the dotScene of the blender file above. There is a lack of materials, and the wheels are all stacked on one another, rotated 90 degrees, and at the center of the model. (The wheels are only visible as the round part at the bottom of the center part of the vehicle).



I realize this isn’t a modeling forum, (I’m not even sure where any good ones are) but any help would be appreciated.

In blender, try recalculating the normal outside for the meshes in edit mode “ctrl+n” before exporting, and apply visual transform(translation, rotation and scale) to the meshes “ctrl+a”. For the materials, make sure they have the same name of them respective meshes. Anyway, you’ll have to create a .j3m material in jMonkeyEngine, you can use the material editor in jmp. Also, I can’t understand why you’re using a old blender version. I use the new one 2.59. Make sure you are selecting all meshes in blender before exporting. It looks your model’s origin is a little decentralized, centralize it by clicking “shift+c” and then “shift+s+selection to cursor”.