PDA

View Full Version : Gotta BIG problem with bones!! HElp Pleas!



maku
31-05-2003, 09:54 PM
I've created a model of man and given him animations and skeleton.
Now I 've made a lot of weapons for him i I dont know how to give it him in game. I was trying to add bone of sword to hand's bone in model but it makes errors. Please Help me any way you want. Please.

Mathew.
Sorry for my language and any mistakes..

Thanks.

Philipp
01-06-2003, 12:54 AM
hi maku,

if your created model is type of "md2" then try do the following:

somewhere're your TGLActors declared

YourActorModel.LoadFromFile('filename.md2');
YourWeaponActor.LoadFromFile('filename.md2');
YourWeaponActor.Synchronize(YourActorModel); // use the same animations as youractormodel

if its all kind of "smd" then this code should work :P *should*

YourModelActor.LoadFromFile('yourbasemodel.smd');
YourModelActor.AddDataFromFile('animation1.smd');
// ...
YourWeaponActor.LoadFromFile('yourbaseweaponmodel. smd');
YourWeaponActor.Synchronize(YourModelActor);

erm.. you could also see the demos in :
/glscene/demos/meshes/skeletal
/glscene/demos/meshes/actor

hth

regards,
philipp

p.s. you can also try to ask on the iRC channel irc.voidzero.com#glscene

maku
01-06-2003, 07:20 PM
I'am using SMD. I was trying to synchronize but it does not work.
I'll try MD2.

Great Thanks for reply Philipp

fig
01-06-2003, 11:27 PM
Did you remember to make the weapon actor a child of the character actor?

stuart
02-06-2003, 03:55 AM
You'll need to update the weapon position each frame, put this in something like a GLCadencer OnProgress event:

Weapon.Matrix:=GLActor1.Skeleton.BoneByID(THE_BONE _ID).GlobalMatrix;

IIRC, the weapon needs to be a child of the actor (could be wrong on that one). THE_BONE_ID is the ID of the hand I would guess.

Good luck,
Stuart.

maku
03-06-2003, 07:38 PM
I'll try it!
I dont know what would i do without your help - my "delphi friends".