## Recommended Posts

realmof    122
Given a quaternion rotating the left arm of a humanoid character, does anyone know how I would go about mirroing this quaternion in order to have it symmetrically animate the right arm? Negating the X and Y angles in Maya gives me the intended result. From that, I attempted to convert the quaternion (on the game code side using a proven library) to Pitch, Yaw, and Roll components, negate the Pitch and Yaw, and then convert back to a quaternion, but that doesn't appear to work. Surprisingly enough, I've found absolutely no help at all through Googling. However, I've read about converting the "quaternion to an axis and angle form, mirroring that, and converting back to quaternion". But as far as I know, you can't just "mirror the axis-and-angle" form since the rotation axis is obviously different than the joint's local coordinate system (i.e. axes). And if it WERE true, how would I determine what components to mirror in the rotation axis? Any help or links to references would be greatly appreciated! Thanks

##### Share on other sites
Palidine    1315
try just multiplying the x,y,z components of the quaternion by -1. that should do the same as flipping the axis. but it'd take some experimentations for me to be sure...

-me

##### Share on other sites
realmof    122
Quote:
 Original post by Palidinetry just multiplying the x,y,z components of the quaternion by -1. that should do the same as flipping the axis. but it'd take some experimentations for me to be sure...

I've tried that as well without any success, but I'll see if I can confirm that in a separate test. Thanks for the suggestion though.

##### Share on other sites
Dmytry    1151
Quote:
 Given a quaternion rotating the left arm of a humanoid character, does anyone know how I would go about mirroing this quaternion in order to have it symmetrically animate the right arm?

You only need to mirror xyz part of quaternion in same way that mirrors humanoid's left hand to be right.
Quote:
 Negating the X and Y angles in Maya gives me the intended result.

hmm.i don't fully understand your problem.
Quote:
 From that, I attempted to convert the quaternion (on the game code side using a proven library) to Pitch, Yaw, and Roll components, negate the Pitch and Yaw, and then convert back to a quaternion, but that doesn't appear to work.

It's required to convert to Pitch,Yaw,and Roll?
Quote:
 Surprisingly enough, I've found absolutely no help at all through Googling. However, I've read about converting the "quaternion to an axis and angle form, mirroring that, and converting back to quaternion".

You don't need to convert to axis-angle,it's not necessary and must give same results as just mirroring xyz part of quaternion.
Quote:
 But as far as I know, you can't just "mirror the axis-and-angle" form since the rotation axis is obviously different than the joint's local coordinate system (i.e. axes).

don't understand that sentence.
Quote:
 And if it WERE true, how would I determine what components to mirror in the rotation axis?

mirror it in same way that mirrors left hand to right.