Help attaching meshes

Blitz3D Forums/Blitz3D Programming/Help attaching meshes

ezekiel999(Posted 2004) [#1]
First I want to say hello to everyone and I can't express enough how much everyone's input on this board has helped me learn blitz/blitz3d over the past few weeks. I pick up something new each time I read through a new thread on this forum.

Eventually I plan on expanding my mini-demo's to create a 3rd-person action game. Well the character and opposition forces will be able to equip themselves with various types of items (armor, various articles of clothing, weapons, etc).

My question is exactly how do I get the equipment/weapon entity to attach to the character entity, such as holding a knife or gun, wearing a cape, etc. I understand that I would basically parent the equipment/weapon entity to the character entity but how do align it at specific vertex or triangle on the character entity. Do I just have to figure out the ideal location through trial and error by positioning the entity (EntityPosition ItemEntity, x#, y#, z# then parent the ItemEntity to charactermodel)?

If that is the case is there any easier way to find the locations I need to have the item entities located at on the character model to move with the character animations with the use of my modeling program, 3dsMax6?

Any help or tutortials about this matter would be greatly appreciated, thanks.


jhocking(Posted 2004) [#2]
If the character has a skeleton (ie. you used b3d file format with skeletal animation,) parent the weapon to a bone in their hand.


Matty(Posted 2004) [#3]
I am after an answer to the same question. Is this how you would do it:

1.Make model in milkshape, with bones named (ie "left hand").

2.Use childentity=FindChild(myentity,"left hand")

3.positionentity weaponentity,entityx(childentity,true),entityy(childentity,true),entityz(childentity,true)

4.entityparent weaponentity,childentity


And then the object/weapon will be "attached" to the bone.

Is this correct?


Gabriel(Posted 2004) [#4]
Yes Matty. Exactly like that. This is how I get my characters to bowl a ball in Bowling Babes.


Matty(Posted 2004) [#5]
Thanks,