MacFiend
2003.03.24, 03:19 AM
In my ongoing escapade of skeletal animation...
lets say I have 2 bones: BoneA and BoneB. BoneB is a child bone of BoneA. When BoneA moves, BoneB moves, and likewise for rotations.
Now thats fine for getting a bone-based mesh to the screen, but I need to know the actual position of BoneB after it has undergone the series of translations/rotations yielded by its parent bone. To clarify what I mean, let me apply this to a real situation...*wink*
A model of a Hummer has a model of a .50 cal machine gun mounted on top of it. The mesh of the Hummer is attached to Joint A. The machine gun is attached to the Hummer at Joint B as a child of Joint A, and the mesh of the machine gun is attached to Joint C as a child of Joint B. When the machine gun fires a round, the round starts at Joint C (the tip of the barrel). As Joint A moves, Joints B and C move along. Now if the machine gun is pitched upwards (Joint B X-Axis), Joint C will rotate as well around Joint B.
I hope you follow me so far. Now if none of the bones (Joints) are rotated, it would be fairly easy to plot the starting point of a round fired by the machine gun. But since that's not the case, does anybody know of a way to figure out the absolute position of Joint C (world coordinates) based on the transformations of its parent?
lets say I have 2 bones: BoneA and BoneB. BoneB is a child bone of BoneA. When BoneA moves, BoneB moves, and likewise for rotations.
Now thats fine for getting a bone-based mesh to the screen, but I need to know the actual position of BoneB after it has undergone the series of translations/rotations yielded by its parent bone. To clarify what I mean, let me apply this to a real situation...*wink*
A model of a Hummer has a model of a .50 cal machine gun mounted on top of it. The mesh of the Hummer is attached to Joint A. The machine gun is attached to the Hummer at Joint B as a child of Joint A, and the mesh of the machine gun is attached to Joint C as a child of Joint B. When the machine gun fires a round, the round starts at Joint C (the tip of the barrel). As Joint A moves, Joints B and C move along. Now if the machine gun is pitched upwards (Joint B X-Axis), Joint C will rotate as well around Joint B.
I hope you follow me so far. Now if none of the bones (Joints) are rotated, it would be fairly easy to plot the starting point of a round fired by the machine gun. But since that's not the case, does anybody know of a way to figure out the absolute position of Joint C (world coordinates) based on the transformations of its parent?