Search Unity

Shoulder joint with quaternion rotations

Discussion in 'Scripting' started by Deleted User, Feb 24, 2018.

  1. Deleted User

    Deleted User

    Guest

    Hi all, first post here,
    I'm not actually using Unity, yet, but it is in the plans. For now I'm coding my own simpler animation system for a shoulder joint (no elbow or wrist), so only the Gleno-humeral joint. I'm using C# for this.

    For various reasons I also want to use quaternions for orientation and rotation. I've studied quaternions in papers and YT clips to the extent that I think I can handle the essential math, but what is escaping me is example of the actual "rigging" scheme using quats.

    I think of a shoulder as having three DOF's, a universaljoint. It could be designed with three individual axles, or with a Spherical coordinate system and following such a model then I would "just do it". But I will rotate the arm both FK and IK and therefore (and for some other reasons) I think quats will be a better choice.

    Anyhow, the rigging. How to rig the shoulder joint using quaternions? In old fashioned cartesian thinking I could define three planes (Frames) using the Z axes as the axis of rotation, pick a rotation scheme and off we go. Using quaternions I imagine that that's not the way one would rig such a joint. I have searched the Internet for examples of rigging, and I only find an endless number of smart guys rambling about ol' Mr. Hamilton and the endless mathematical proofs over and over again (I do believe that the math works, I need no more proof, only the concrete rigging). The "geometric" set up, from A to B to a scheme that would rotate the shoulder. The details of the math I will "take care of at home" so to speak. It's the rigging strategy I'm after. preferably with illustrated examples.

    So, I'd like to know if someone here has any links or hints about books for dummies with illustrated examples of how to rig such a joint using quaternions.

    What I already have is a mesh model and a ellipsoid class which orients and autofit itself to the humeral head, with three radius. I can FK rotate the thing using spherical phi and theta, and I can orient a vector from an external point inwards to the ellipsoid center and calculate any intersection point on the ellispoid surface given any point in World coordinates while the ellispoid is arbitrary rotated & translated.

    So I do essential euclidian trigonometry and I play around with vectors (which resembles some aspects of quanternions as well). But how to build a concrete joint with quats escapes me.

    For example, should Frames be used also together with quats? (how else would I have any point of reference?). And, can a quat be used as a pure "hinge" with its vector part as the rotation axis? And regarding Frames again - the rest position of a human arm is naturally hanging straight down (righthanded Z down, if I were designing a robot system) while the normal of the Glenoid's cavity would seem to be the most natural Frame to rotate about, but such a Frame would have its normal (Z) pointing laterally, to the side, straight into the rotation center of the humeral head, aso. Hints on where to find step for step descriptions of how this joint should be organized using quats, and how the essential rotations should be generated, and where from/how to define reference quaternions, would be most appreciated.

    Sorry for this long post, but why do I find only detailed math and it's proofs out there, but very little or nothing about how to rig and use quaternions in the real physical world?

    -- LR

    PS: For now I'm coding this using VS and animating it in Rhino-GrassHopper. Essential geometry looks pretty much the same in Rhino as in Unity, much low level code would run with very little modification on both platorforms, so the basic reasoning can be pretty much the same. No use of animation libraries, I would spin my own Slerps to smooth things out, aso. Again, it's the basic set up strategy I'm interested in.
     
    Last edited by a moderator: Feb 24, 2018
  2. MJ042

    MJ042

    Joined:
    Nov 1, 2020
    Posts:
    1
    @LAROM, Did you manage to find an answer to this?