Members - Reputation: 100
Posted 28 February 2012 - 02:09 PM
I'm working on a new project where different types of characters can wear different clothes, tools, etc. I've done a project like this in 2D and it just required that I make new sprites, not a big deal. The new project is going to be in 3D (using XNA), so I was wondering:
1. Would it just be easier (though time consuming) to just create a new model for every different set of equipment (i.e. guy in fatigues, guy in plate armor, guy in t-shirt/jeans) ?
2. Would it be easier/more efficient to render the equipment onto my base character models based on their dimensions (i.e. breast plate is scaled based on model's width, depth, and height and placed with relative coordinates to the model's torso)?
I've done some work in 3D as far as hierarchal modeling that I believe might be the correct direction to go, but I'm not sure (this being my first 3D game).
I'm not asking for code or anything, just some psuedocode or a general direction will be tremendously helpful. I'm still quite a bit far away from actually rendering models to the screen, so its not that urgent. Really just curious.
Members - Reputation: 1297
Posted 28 February 2012 - 04:26 PM
If your characters are rigged, then you can just load multiple models and attach them all to the same skeleton instance. As long as the peices are designed to fit together, everything just works (e.g. if you do body shape scaling by affecting the skeleton, then it will affect the body model, the chestplate armour model, gauntlets model, etc)
Members - Reputation: 604
Posted 29 February 2012 - 03:51 AM
ea, one drawcall.
the way i would do it would be like this :
1 : find the models current itemset
2 : load the correct items, ea, right arm, left arm, torso, head, legs and more to it.
3 : combine the vertex & texture buffer
4 : unload all the data we dont need anymore (models and texture that we just combined)
5 : in the shader have input params controlling the length, size and other personal stuff about the charcter.
hope this would help. (btw, this way will work with animation aswell)