I've downloaded BVH animations and projected it following a book. I can now see a 3D moving rig and it looks alright. The problem is, now I want to plug a sword on the hand of the rig, but I don't know which direction it should face. That is because each vertex has a rotation and an offset, so I can calculate their positions, but there is no information available about their normals. How is this done?
Pseudocode of the position finding procedure for illustration
calculate_position(bone) local = bone.rotation_x * bone.rotation_y * bone.rotation_z # matrices local = bone.offset_x local = bone.offset_y local = bone.offset_z global = local * bone.parent.global return [global, global, global]