3D models general questions

Sort of neewb about model stuff, so bear with me.



I’m at that point now where I’ll be implementing basic enemy ship models and I’ve got questions regarding this in general.



Since my game supports crafting, you’ll be able to craft new ship weapons or improve the ones you have. That means new weapons will have to be glued somewhere on the ship to be placed when crafted.



If I remember correctly, the Source engine (and other engines) uses bones as attachment. Is my memory good? Is this how it works? If so, how does that translate to jME? The SDK? Can that be done live and on-the-fly or would I need to use a different model with those weapons attached? Digging into my memory tells me that it might also be used as an animation, but it’s very fuzzy. I’m not sure exactly how to tackle this.



Just for kicks I made a pretty bad model this afternoon in blender but the SDK refuses to convert it. I tried Ogre, same result. I get “Cannot import this file!” But, if I export it to .obj it imports and displays fine in-game.



Since the Ogre exporter has changed in Blender 2.62 the wiki’s export options seem incorrect or wrong. Unsure exactly. I tried following the steps but some options in the new exporter are inexistant or I can’t relate the old with the new ones in the latest exporter. My guess is, I’m doing it wrong, so if someone who knows what options to use would be so kind as to update the wiki, I’d be grateful. (Even the exporter GUI is totally different) The instructions I used were those found here.



If the model is needed to troubleshoot I’ll make it available if no mention of its ugliness is made. :wink:

I don’t know why bones wouldn’t work, isn’t there an attachment node on them that you could use?

For our game, we just use a node structure to be able to place visible ship components on the ships where they should be.

No problem doing it live or on-the-fly. We’re just using some simple programmed animations for now though, like rotating laser mounts.

1 Like
@Tumaini said:
I don't know why bones wouldn't work, isn't there an attachment node on them that you could use?


Let's just say that I can model a bit. Extrude, move vertices, scale etc. Attachment node!? In Blender? #lost

Hi,



In Blender, with your model loaded, why not just place “Empties” (Shift A > Add Empty) where you’d like to eventually glue the attachments in the game. Name your empties accordingly, then make the model the parent of the Empties (select children > select parent > ctrl+P) before exporting.



Then in JME3 you can add/remove the attachments as child nodes of the empties.



Mind you - I’m a novice myself, so there may be a better way, but that seems logical to me.



As for Ogre in new Blender 2.6… It works for me, but I’m not at my PC right now so can’t help with the options, but are you sure you’re importing the “.scene” file (exported by Ogre), not the “.blend” file (Blender’s native format)? Also, make sure you select the “save meshes” & “overwrite Meshes” option on export.

1 Like

@jonmonkey

Thanks for the tips. I’ll check that up tomorrow.



Much appreciated.

The skeleton has attachmentNodes.

[java]

SkeletonControl skelC = spatial.getControl(SkeletonControl .class);

Node attachNode = skelC.getAttachmentsNode(“boneName”);

// hook it onto here

[/java]



Any blender animation or armature tutorials on youtube will help. The blender site has some great ones too (the site is not responding at the moment or I would paste you a link).



Basically make the model, give it a skeleton in blender. Name the bones in the skeleton. Note that the attachment part of the bone is the root of the bone, not the end of it! Export the model as an ogre model. Import into jme etc.

When you load the j3o, it will find the skeleton, and make the SkeletonControls automatically for you.



Exporting to ogre is tricky. You need a root bone with no transformations, NONE. Located at 0,0,0, no scale, no rotations.

This thread will help: http://hub.jmonkeyengine.org/groups/import-assets/forum/topic/blender-2-61-animation-issues/?topic_page=2&num=15



Start with just a box, export it with a bone and see if that works, then go on from there. It takes some practice.

1 Like

Oooh! More tips! Thanks @sploreg

I’ve always found .obj to he the most reliable for me, but it doesn’t do animation. @mifth recommends blender 2.62 with the hlender2ogre exporter, not sure if thats the same one the SDK installs

yeah, blender2ogre: http://code.google.com/p/blender2ogre/