Atm I am working on a RPGame, and each player has some items on (helmet, body armo - shirt, pants, shoes etc) And with each o these it should look differently.
I am thinking of doing it like a Player object which extends Node, where it either attach or overide the draw function, and then have each of the body parts. Which is a node too. However I see the problem in what when the character should hit with he's sword, or just walk.
Any suggestions ? I am open to rethink it all over, since I have created no code yet.
Thnx in advance
This heavily depends on your models… Perhaps the easiest way would be if your characters are a bunch of meshes, one for each bone (torso, head, forearm, arm, etc.), and then just changing the respective part would do the trick… Now, animations would be somewhat a problem if you have them embedded in the player model.
The other situation (with the embedded animations) is trickier, as it requires that you extract the individual anchor points and rotations of the animation frame, and then attach the armor pieces to the player model in the right places and with the right orientations.
This is not a trivial matter, and you should consider getting your models first, or talking to your artists (if they are not yourself ;))
i would think composition over aggregation here
I'd like to hear about a solution to this, too. I never tried attaching nodes to some anchors of a model. Is there a tutorial for this in JME? Maybe a simple avatar with a hat on it that could be switched on/off? That would help a lot.
Then again, this is format and model dependent… Collada uses different format for animation than, say, MD2 does. What is required is to extract the bones transformation information to apply that as a transformation to a node attached to the model.
Sorry I haven't respone, I am on vacation so don't got much internet here.
Well duenez I haven't made any models yet, I am still reading about blender which seems very good.
I would like to know what approach there would be best to go for. I am thinking making each part of the body in differently models and then put on a bone model to get it to work all togther, however I got no experience at all with this subject, so could you tell me what would be the best way to go for.
Remember I got no models yet, and I am still learning blender.
Thanx
The main problem with making each part of your character a node (and a 3D model) is that on closeup, you would be able to see the joints, instead of seeing only a smooth model. Of course there is also a speed and optimization factor, since 16 meshes per character, each one with its own translation, texture, rotation, light, etc. might be too much. Even if this approach is easier for pluggable armor pieces and stuff.
This is not an easy issue, and you need to understand that it is dependent on your target. If you want cutting edge performance over simplicity, then a smooth model with attached pieces reading the bones animation directly would be a good attempt. Regardless of what you decide, let us know so we can help further