hello,
i used the code in the bloody masacre to create a character carrying weapon, but strange thing is happened,
u can check out the image attached, where u can c the right arm is completely turned in the opposite way.
here the code that i used to allign the hand to the head
Vec current_dir=point->cross();
Matrix3 transform; transform.setRotation(current_dir,desired_dir,b_aim_r); // COMMENT A
cskel.transformInWorldSpace(sac.arm_ru,transform);
and this is the code to allign the weapon with the hand :
if(OrientP *point=owner.cskel.findPoint("HandR"))
{
Item &item=active_weapon();
Matrix &matrix=slot_matrix; item.matrix(Matrix().setPosDir(point->pos,point->cross(),point->dir));
Vec vel,ang_vel; //COMMENT B
GetVel(vel,ang_vel,matrix,item.matrix());
matrix=item.matrix(); //store new matrix
}
i tried to multiply the desired_dir in "COMMENT A" with -1*desired_dir i got a correct rotation for the hand, but this modif affects the orientation of the weapon ...
tx for the response
each mesh has its own skeleton, so i cant use the masterChief's skeleton for the soldier one,
but in essenthel the same naming convention and orientation for skeleton bones are used (that what i expect!),
that is why i am asking the question
I tried it. But i got wrong rotation for the weapon, well i need to find the source of the problem thus i can fix it, should i fix the skeleton bones in the meshviewer?
Tx in advance
If it's just the weapon that's rotated wrong, like it's turned 90 degrees or something, you should just have to rotate the weapon inside of Mesh Editor. Open it, use Ctrl+Y to rotate, and re-save it.