help me add weapons to md2 [screenshot]
help me add weapons to md2 [screenshot]
How can i add a wepon into my md2 guy?
i have the weapon.md2 file...
i have the weapon.md2 file...
That would require an immense amount of animations... it's not practical. especially if [ehich i do] you plan on using many different gunsArmen138 wrote:usually the weapon 'animation' is synced with the character, so simply adding the weapon.md2 at the same position and rotation as the character would do the trick.. cant hurt to try
BESIDES, animation flags like this work (see screen below) which makes me believe there should be some access to these bones after loading the mesh:
node->setMD2Animation(scene::EMAT_SALUTE);
stop refering to bones and md2 together. When you create a md2 in an animation package there are NO bones. It workes purely on key frame animation from a deformed mesh.
Each animation has been created in the animation package and is stored as part of the file. These animations define the vertex position at key frames of the animation and the rest is interprolated.
For bone animation formats like .x, each vertex is affect by one or more bones. This information is stored in the file. The animations define the position of the bones, again at key frames. The position of each vertex can then be determined using the stored bone->vertex info.
As no bone as such exist in md2 you can't just attach the weapon to a bone and have it completly animated in sync with the model. Two possible methods are the one Armen138 stated, or it might be possible to fake a bone, by looking at the postion of certain vertices on the arm/hand and using these to determine the position of you weapon.
Each animation has been created in the animation package and is stored as part of the file. These animations define the vertex position at key frames of the animation and the rest is interprolated.
For bone animation formats like .x, each vertex is affect by one or more bones. This information is stored in the file. The animations define the position of the bones, again at key frames. The position of each vertex can then be determined using the stored bone->vertex info.
As no bone as such exist in md2 you can't just attach the weapon to a bone and have it completly animated in sync with the model. Two possible methods are the one Armen138 stated, or it might be possible to fake a bone, by looking at the postion of certain vertices on the arm/hand and using these to determine the position of you weapon.
I was going to need this for my project but i think i may not bother now. What i did early on was load a md2 and then add it's weapon as a child. The md2 was of one of those things from the new Star Wars trilogy, the robots that curl themselves up and roll around... The weapon.md2 that came with it when added as a child aligned into the proper position but its animation was out of time i think.. It didn't move in exactly the same way..
Also when i added a bfg to a Johnny 5 (Short Circuit films) it was positioned on his shoulder, which is where it should have been, but again it was out of time with the animation.
Also when i added a bfg to a Johnny 5 (Short Circuit films) it was positioned on his shoulder, which is where it should have been, but again it was out of time with the animation.