oculus-samples / Unity-Movement

Body, Eye and Face Tracking code sample.
Other
272 stars 46 forks source link

Retargeting of hips rotation #37

Closed haaappytoast closed 10 months ago

haaappytoast commented 1 year ago

Hello, I have two questions.

I'm using sample scene, retargeting, that you provided in Movement SDK. As I controlled avatar(ArmatureSkinningUpdateRetargetUser) with left and right hand controller, I found out that even though I'm not moving my torso, the avatar's hip keeps rotating whenever I punch forward with left or right hand respectively. Is there any way to fix the hip rotation and make it not rotate?

Also, I'm smaller than Armature so even though I stretched my arms fully, the avatar's arms are slighly bent because of the difference of bone length between mine and the avatar's. Would there be any way to solve this problem? I was thinking of using other model that has similar length as mine but it seemed so burdensome so I hoped there's way to use the provided one.

Thank you very much.

andkim-meta commented 1 year ago

Hello.

1) Hip rotation when you punch. Even though you aren’t moving your torso, you probably have some head rotation which is in turn causing the body to rotate slightly. If you want to prevent this rotation, you can add a constraint to prevent this motion. If you are using animation rigging, you can see examples of constraints under the Rig in the character’s hierarchy. However, you should be aware that this might limit you in other actions (e.g., turning to the side).

2) Elbow deformation when holding your arms straight. There is a tradeoff that we make between keeping the original dimensions of the character whose bone lengths won’t match exactly the person wearing the headset. If you think about the skeleton as a series of joints that can accept a rotation, then given an angle of rotation, the end point of the opposite end of the bone would be in a different virtual position depending on the length of the bone for exactly the same angle. If we only use rotations, then the character looks exactly right, but the position where the hand ends up may be very different. As such, to make the positional accuracy correct, there is a checkbox “Correct Position In Late Update” with two sliders that allow the weight to be blended. If set to one, the position of the hands will be accurate. We then apply the Two-Bone IK to fix up the elbow positions. By adjusting the weights of the Right and Left Hand sliders when holding your arms straight in front of you, you should be able to get the effect that you desire.

andkim-meta commented 10 months ago

Hello. We have some updated documentation on setting up a retargeted character here that should help resolve the issue: Setting up a character for body tracking. Closing this issue for now.