confused with joints

Blitz3D Forums/Blitz3D Programming/confused with joints

InvisibleKid(Posted 2003) [#1]
hi, i have a character model and a weapon model.
what i want to do is attach the weapon to the hand joint, but this findchild stuff is confusing me and i can't get it working.
here is the joint list using Robs xtree function
    11291728 base
        21274632 pelvis
            21347024 rhip
                21347776 rknee
                    21348528 rankle
                        21350240 rfoot
            21351360 lhip
                21227776 lknee
                    21229488 lankle
                        21231232 lfoot
            21232392 chest
                21328736 rsb
                    21330128 rshoulder
                        21332000 relbow
                            21333952 rwrist
                                21205648 rhand
                21206808 lsb
                    21207568 lshoulder
                        21209440 lelbow
                            21211392 lwrist
                                21233656 lhand
                21234440 neck
                    21235680 head


i know Joint19 is the one i want i just don't know how to attach to it.
any help would be most appreciated.

TIA


Beaker(Posted 2003) [#2]
Have you tried:

joint = FindChild(ent,"Joint19")
EntityParent newthing,joint

??


InvisibleKid(Posted 2003) [#3]
yes and it didn't work :(
i searched the forum on this subject tried all the suggestions that i saw, i'm just not grasping it i guess.


DarkEagle(Posted 2003) [#4]
using loadanimmesh, right??

oh - and your a metallica fan, also, correct? :)


InvisibleKid(Posted 2003) [#5]
lol ummmm yes to both

i just can't seem to get it to find any of the joints

heres an snippet of what i'm trying

Global dude = LoadAnimMesh("guy.b3d")
PositionEntity dude,0,0,50
TurnEntity dude,0,45,0

ExtractAnimSeq(dude,0,13)	;idle1
ExtractAnimSeq(dude,13,39)	;idle2
ExtractAnimSeq(dude,39,59)	;idle3

Global weapon = LoadMesh("pistol.b3d")
TurnEntity weapon,0,45,0
Global hand = FindChild(dude,rhand)
Global msg$
If hand Then msg$= "yes" Else msg$ = "no" ; just for testing
EntityParent weapon,hand



edit: i figured out how to rename the joints in cfx and changed the first post accordingly, to give a better understanding of the tree


Beaker(Posted 2003) [#6]
You missed quotes "" off your Joint19 in the FindChild command!!

hand = FindChild(dude,"Joint19")


InvisibleKid(Posted 2003) [#7]
i just added the quotes (didn't know you needed them), but it still didn't work. i'm guessing it has something to do with child of the child of the child ... etc. but i don't understand how to access the children of children...

when i do a countchildren on the entity it only finds 1. i remember seeing a post about this sometime ago but can't find it now.

edit:

got it semi working after doing some more searching, i had to do it a bit differntly though
Global hand = FindChild(dude, "rhand")
Global weapon = LoadMesh("pistol.b3d",hand)

entityparent wouldn't parent the weapon to the joint, so i'm gonna have to figure a way to get that working right now. but hey its a start and thanks for your help


DarkEagle(Posted 2003) [#8]
when you say it wouldnt parent it, does the weapon move when you move the dude? if so, it has parented, its just that the weapon hasnt been positioned at the right coordinates.


InvisibleKid(Posted 2003) [#9]
ya i think its sorted now i had to entityparent weapon,hand,0 and everything seems to be good now (fingers crossed) again thanks for the help guys its much appreciated