# Skeletal Animation Mirroring

This topic is 2537 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Im trying to mirror an animation but I cant seem to get it right. Most of the info Ive found has been incomplete with no definitive way of going about it. Most sources seem to suggest you simply negate the axis you want to mirror for the translation, and rotate through a mirror plane, but Im having my doubts that its that simple. The main issues Im unclear on

1) Is it as staight forward as negate and rotate (using quternions by way)

2) Does the construction of the underlying joint local transforms matter, is mirroring only possible if the rig was setup for it (besides the obvious, left joints need mirrors on the right, ie a biped)?

For instance when looking at the rig in its bind pose, there doesnt seem to be any consistant operation which can be performed on all left joints to orient them like the right. Arm local transforms look like they were mirrored using a vertical rotation of 180, while feet or legs look like they were mirrored using two rotations on two axes.

3) What about middle joints with no opposite? It feels as though you cant simply ignore them, as some sources seem to imply. If a middle joint rocks back and forth to perform some action, it seems they would need a flip too once the opposite joints are swapped in order to look right.

The concept seems straight forward, you have a symetrical skeleton, an animation plays changing the local transform of the joints (say a right hand doing an uppercut), whatever the right side is doing you want the left side to do and vice versa, but Im lost.

If anyone has any suggestions or references, that would be helpful.

##### Share on other sites
Since nobody seems to reply I'll try to give you some answers

1) Is it as staight forward as negate and rotate (using quternions by way)[/quote]

To mirror a rotation along one given axis, yes it can be. If you want to make it more flexible you need a little more work, but also just a tiny bit of code, like a vector mirror.

2) Does the construction of the underlying joint local transforms matter, is mirroring only possible if the rig was setup for it (besides the obvious, left joints need mirrors on the right, ie a biped)?

[/quote]

Yes you need to preprocess some things to do mirroring at runtime. There are different ways to implement mirroring though.
But to be able to mirror at runtime some things need to be proprocessed. If I remember correctly I remove some rotations/scale, basically simplifying things.

3) What about middle joints with no opposite? It feels as though you cant simply ignore them, as some sources seem to imply. If a middle joint rocks back and forth to perform some action, it seems they would need a flip too once the opposite joints are swapped in order to look right.

[/quote]

You also mirror those, you just use the same source motion data. Basically you mirror the entire motion.
So what is playing on the right hand, you kind of apply to the left hand, but in a mirrored form. Because if you point your finger to the right, you want it to point to the left when playing on the other side of the body.

It has been a long time since I implemented this, but I remember there were some cases where it didn't work, so thats where some special preprocessing came into play, which I do at export time.

Hope this helps a bit at least. I remember it was pretty straight forward, you could get results pretty fast, but then some things didn't work, which complicated it a bit more. But in the end it is not so hard

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633708
• Total Posts
3013468
×