mgear-dev / shifter_classic_components

Components library for Shifter
MIT License
1 stars 10 forks source link

arm_2jnt_04: wrist align and plane normal #59

Closed tokejepsen closed 5 years ago

tokejepsen commented 5 years ago

Problem

When using the wrist align feature, the wrist and the elbow can get twisted resulting in flipping.

Capture

tokejepsen commented 5 years ago

The problem is with the calculated normal, which does not take into account the rotation of the wrist.

My vector skills are not very good, so I'll need some help with this. I'm trying to setup a simple reproducible code, where I can visualize the problem and try to solve but I'm hitting a wall already with converting a vector to a rotation/matrix;

import pymel.core as pm

from mgear.core import primitive, vector, transform

guides = ["arm_L0_root", "arm_L0_elbow", "arm_L0_wrist"]
guides = [pm.PyNode(x) for x in guides]
positions = [x.getTranslation(space="world") for x in guides]

normal = vector.getPlaneNormal(positions[0], positions[1], positions[2])
miquelcampos commented 5 years ago

Hi @tokejepsen

I will check this as soon as I have a little time.

tokejepsen commented 5 years ago

This does not seem to be an issue anymore.

Could be that https://github.com/mgear-dev/shifter_classic_components/pull/58 solved this as well.

miquelcampos commented 5 years ago

Hi @tokejepsen How do you fix it?

tokejepsen commented 5 years ago

I honestly dont know, but the issue is not there anymore after rebuilding.

I suspect it might be related to #58.