Question by
Nasaman · Jun 18, 2017 at 08:55 PM ·
3dorientationbonesangles
Angle between human bones
I am working on some kind of ergonomical solution in Unity and I need the angles between bones. And I am very confused, because I can't figure out, how to get the angles. It seems, that this is the right way:
https://forum.unity3d.com/threads/read-the-angle-between-an-object-and-a-world-axis.89380/
But it does not work for me in the local angles. I have the angles from figure:
elbowRightOrientationWorker = GameObject.Find("joint_ElbowRT").GetComponent().rotation.eulerAngles;
elbowRightOrientationWorkerForward = GameObject.Find("joint_ElbowRT").GetComponent().forward;
elbowRightOrientationWorkerUp = GameObject.Find("joint_ElbowRT").GetComponent().up;
elbowRightOrientationWorkerRight = -GameObject.Find("joint_ElbowRT").GetComponent().right;
upperArmRightOrientationWorker = GameObject.Find("joint_ShoulderRT").GetComponent().rotation.eulerAngles;
upperArmRightOrientationWorkerUp = GameObject.Find("joint_ShoulderRT").GetComponent().up;
upperArmRightOrientationWorkerRight = -GameObject.Find("joint_ShoulderRT").GetComponent().right;
And I try to get the angles in wrist - if the palm is bended up/down or left/right. The rotation should be taken from upper arm (it is impossible to rotate only wrist and not the forehand).
wristAngle_Left = Vector3.Angle(elbowLeftOrientationWorkerRight, wristLeftOrientationWorkerRight);
wristSide_Left = 90 - Vector3.Angle(elbowLeftOrientationWorkerRight, wristLeftOrientationWorkerUp);
wristTwist_Left = 90 - Vector3.Angle(Vector3.up, wristLeftOrientationWorkerUp);
But the angles are strange. Or are affected by another rotations. Is this the right way and I only take wrong formulas, or is it complete wrong idea? Thanks for help...
Comment
Your answer
Follow this Question
Related Questions
Trouble finding angle relative to axis 0 Answers
Bug floating object when fixed to bones 0 Answers
How to get the angle between the xz plane and the object 1 Answer
Importing Unity Store Asset from project into blender. 0 Answers
Skinning Editor Bones Disappear,Bones disappeared from Sprite Editor after Exiting Unity 4 Answers