[=iferoporefi;334674]
I want to share with you my experience with hand rotation. I had a lot of problems before and I think that maybe some other noob, like me, will enjoy with my solution:
My first problem were the rotation. As we already know Euler rotation aren’t so good because of gimbal lock and minimal angular changes that causes maximum rotations, so I had to tweak my rotations and adding something here, subtracting there, invert axis and so on and so forth.
While looking at your solution had different angular recalibration due to different hand’s bone axis rotation. Thus, since quaternion does not suffer of gimbal lock and are best for rotation here comes my solution at the problem:
Why not rotating the Hydra controller quaternion to match hand’s quaternion? Doing so I can avoid tweak for recalibrating hands and just use the rotation of the hydra and the hands will rotate perfectly.
- First of all we need to calibrate, so after putting our self in T-Pose we press the left Hydra button and then do the calibration
…
…
…
some times the HydraID is inverted, so we check and swap it if needed. We get the shoulder mid point and into Set Quaternion Offset we get the difference (in quaternion) between Hydra and hand quaternion, and save the value locally (code will be added below). - In playerController we get, every tick, the Hydra controller data and save position and rotation in local variable that will be given to the animation blueprint of the character.
…
…
We add the position of the hydra with the position of our hydra-shoulder mid-point and the shoulder midpoint of the character (is a fixed position). GetProperHandRotation rotate the Hydra quaternion with the offset quaternion saved during the calibration and in output it give the “real” rotation of the hands relative to the T-Pose. - is the code
…
I had to create temporal variable, it is probably a waste of resources but without doing so it crashes all the time
PS. I had to modify the plugin to get the quaternion in blueprint. Probably the good way will be to attach the plugin to the playerController.cpp but I found much easier and readable accessing via blueprint.
Sorry for my bad english, I’m working on it.
[/]
Hey iferoporefi cool share there, though some things could be a bit simpler :). In general the rotation of the hydra shouldn’t need calibration instead you only calibrate the base location in relation to the user and then require the hydra to be properly facing forward (cables coming out of the back of the base station). The other thing I would raise is that you can avoid quaternions in blueprints completely by using combine rotators which take rotators and use quaternions internally.
[=iferoporefi;331999]
Hi . First of all, thanks great work.
I’m new with UE4 and I’m starting to work on animating a character arms based on Hydra controllers. I got a question regarding IK while rotating hands. I’ve used @cleerusher123 calibration and it is perfect, cheers man.
My questions are: “How do I rotate my forearm and arm while rotating my hands”? “Is there a common position to set arm pole vectors while using FABRIK”?
Cheers
[/]
Generally you IK/FABRIK to your wrists and then use FK for the wrist rotation. If you want to link the wrist rotation to the elbow e.g. something like the chicken maneuver you would need to move the effector location based on a vector pointing from your desired rotation ‘bottom’.
[=Brunohbk;327099]
Hi , thanks for developing plugin, it’s great and it’s really helpful.
Anyway, i have a question for you.
I’m trying to rig the arms of a 3D character with Hydra.
I have linked the wrist joints to the hydra controllers, but I would like to get the local rotation instead of the global rotation.
Is there a way to get it?
Any help appreciated.
[/]
In blueprint you use combine rotators with the rotations you want to combine. E.g. if you wanted to add the pawns facing rotation you would combine the hydra rotation with the pawn/control rotation and the net result would be the sum of the two.