Loading AnimMeshes
Blitz3D Forums/Blitz3D Programming/Loading AnimMeshes
| ||
If I load in an Animated mesh, say of a person. The animation makes the person shoot a gun, only the model doesn't posess a gun. This way, I hope to be able to 'parent' different gun meshes to the hand of the animated mesh as required. Will Blitz3D animations 'know' that the gun should move with the hand, or will it just remain parented to the centre-handle-point of the mesh itself? If necessary, how can I specify the gun to move with the animation? |
| ||
Stick a bone on the end of the hand call it "gun" or something, gunlocation = findchild "gun" and position the actual gun at the entityx(gunlocation,true), entityy(gunlocation,true), entityz(gunlocation,true) and rotated entitypitch(gunlocation,true), entityyaw(gunlocation,true) and entiyroll(gunlocation,true). Job done. |
| ||
Stick a bone on? What IS a bone, like a pivot? and how do I 'stick one on'? Especially if I could just 'stick stuff on' I would stick my gun direct to the end of the hand. |
| ||
Models have bones for the animation, the bones are what make the various verts move around to create the animation. Load your model into a modeller... add another bone... save. |
| ||
Hehe thanks, Rob! |
| ||
Forgot to mention... Load your model into a modeller... add another bone... put it in the right place and attached to the right bone... save. |
| ||
How do you call or refer to that bone in blitz? |
| ||
or you could use a bone already in the hand if its got one there just getchild() parent the weapon to a bone in the hand using findchild() or getchild() i think its something like 1: grab the bone in the hand, you will need to know its name handbone=getchild(entity$,bonename$) 2: parent the weapon to handbone EntityParent weapon,handbone |
| ||
By parenting a pivot to the hand, you end up having to control the gun's aim programatically, or have it absolutely glued to the hand. Better to use a bone in the original animations. You can then animate the gun independently, e.g. The character spins the gun once on his index finger, before taking aim. |