Skeletal Animation

wil

Newcomer
Joined
Dec 1, 2004
Messages
7
I'm relatively new to DirectX. I'm playing around with a simple game with cannons shooting at each other (think Scorched Earth).

I started out loading .X models into Mesh objects and just rendered them. When rotating/elevating the cannon I would simply rotate the entire model, which looks junky.

So I figured the best way to do this is with skeletal animation. Though I don't want to 'play' an animation. I just want to rotate the bones to cause the corresponding parts of the mesh to move (rotate). I used 3DCanvas to create a model that works and by rotating the correct frames I get the desired result.

When you press the Enter key I create a projectile and send it flying in the direction the cannon is facing. The problem I have now is the projectile is created at the origin of the model, not the end of the barrel. How can I figure out how to position the projectile at the end of the barrel?

FYI, I converted the SkinnedMesh sample for the C++ SDK to VB.NET.

Thanks
 
About the proectile thing: Figure out the distance from the origin to the end of the barrel (use your 3d modelling program and figure it out manually) and translate the world accordingly..
for example:

End of barrel: 0,1,0
Center of cannon: 1,0,0

You'd translate the world 1 unit upward and one unit left before rendering the projectile. I understand this is a makeshift way, but I think it's probably the only way of doing this (another way would be to use Mesh.Intersect to find the end of the barrel and do what I said above)
 
No problem. I don't think its 100% complete, but it does work. I'll post it when I get home.
 

Attachments

Last edited:
Back
Top