Combining MD2 models?

Started by phlux, July 30, 2013, 04:55:10 PM

Previous topic - Next topic

phlux

Hello!

I've already tried the search but to no avail. Right now I'm just playing around with the engine and have a look at whats possible and what not. I've seen that the engine supports loading MD2 models and also playing animations. However the models don't hold any weapons in their hands and my question now is, if there is a way to load two models combine them and play a skeletal animation?

For example let's say you have a MD2 model of a knight and also a model of a sword, can you add it programatically to the hand of the knight and the character model uses it correct in its animations?

Thanks in advance
Chris

EgonOlsen

Quake2 model do this all the time, simply by having two separate models for the player/npc and the weapon. The animations are created in a way that the same animation index applied to both makes sure that they are aligned. If the animations of a weapon and body don't match, there's not much you do in code to fix this.

phlux

Thanks for the reply. So when I create models and weapons I need to align them so it looks like the model holds the weapon and make them share the animations.

EgonOlsen

Basically. However, i normally have to do the alignment in code (because it somehow never fits). But that animation itself has to fit.