About Store Forum Documentation Contact
Donations:
243$/mo



Post Reply 
character carrying weapon
Author Message
caspersky Offline
Member

Post: #1
character carrying weapon
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 ...

any solution ?


Attached File(s) Image(s)
   
08-30-2010 02:27 PM
Find all posts by this user Quote this message in a reply
Yurci Offline
Member

Post: #2
RE: character carrying weapon
In Bloody massacre is different skeleton. U're sure u use that same skeleton to animate ?
08-30-2010 03:23 PM
Visit this user's website Find all posts by this user Quote this message in a reply
caspersky Offline
Member

Post: #3
RE: character carrying 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
08-30-2010 03:34 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #4
RE: character carrying weapon
item.matrix(Matrix().setPosDir(point->pos,-point->cross(),point->dir));
08-30-2010 09:02 PM
Find all posts by this user Quote this message in a reply
caspersky Offline
Member

Post: #5
RE: character carrying weapon
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
08-31-2010 09:52 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #6
RE: character carrying weapon
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.
09-01-2010 12:33 AM
Find all posts by this user Quote this message in a reply
caspersky Offline
Member

Post: #7
RE: character carrying weapon
tx u for the idea,
i will try it
09-01-2010 09:15 AM
Find all posts by this user Quote this message in a reply
Post Reply