3

I'm learning about inverse kinematics, and am trying to write a human skeleton simulation. I am having trouble deciding how to parameterize the rotation of a ball-and-socket joint.

Two methods that I can think of:

  1. The familiar axis-angle (or Euler angle) way. Can change the characteristics of the joint by changing the order of rotation. Can also just use rotation matrices. enter image description here
  2. Using two quaternion rotations, one along the axis of the bone, and one to determine the orientation. I think this is more intuitive in terms of simulating the joint. enter image description here

So which one should I use? As far as I can make out:

  • The axis-angle method is prone to gimbal-lock, which I can visualize
  • For the other method it is ambiguous as to which axes should be used when calculating the Jacobian entries - the v vector thing in this equation enter image description here

(source: https://www.math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf, page 5)

I'm inclined to use the second method as I can get around the problem by using CCD instead of Jacobian pseudo-inverses. But I would just like to know which of these methods is used as standard (axis-angle or quaternions), and if so, what are the particular details I need to take into account if I were to adopt it.

Any advice would be helpful, but preferably professional, and in a non-esoteric language should you be kind enough to spare some code :-]

  • It all depends on the operations you plan to use with joint. – minorlogic Mar 15 '16 at 09:28
  • @minorlogic can you expand? I plan to mimic the human thigh joint –  Mar 15 '16 at 10:38
  • for solvers you'd need a non-redundant set of variables, so you'd need to use angles. also, are you sure you actually need twist (rotation around the main bone axis)? real joints rarely have it, since it's easy to lean a bone sideward with contracting muscles, but twisting is rather non-trivial. if twist is not necessary, you are down to just 2 angles. – Anton Knyazyev Mar 15 '16 at 11:30
  • @AntonKnyazyev there is _some_ twist in the human thigh so I need 3. but I'm worried about gimbal lock –  Mar 15 '16 at 11:47
  • yeah good point. also the head and the hands. although it's not clear how useful all of them are for full body IK solvers. one might decide to deliberately lock them to get better looking results. then again, i imagine there are cases where they are necessary. – Anton Knyazyev Mar 15 '16 at 13:11
  • @AntonKnyazyev do you know how Blender does it? I'm allergic to popular quasi-professional-grade free software packages –  Mar 15 '16 at 15:02
  • sadly no. i made an IK solver myself at one point, and it was using angles (although i stored them as sin,cos for efficiency) – Anton Knyazyev Mar 15 '16 at 18:19
  • @AntonKnyazyev were you able to overcome the gimbal lock problem, e.g. by introducing rotation limits or something? And if so, in which order should the axes be used in that v-vector equation ? –  Mar 15 '16 at 21:11
  • any body IK needs limits anyway, otherwise it'll produce totally random results. and most solvers are velocity- (or derivative-)based, the order of rotations doesn't really matter, since they all rotate "at once" – Anton Knyazyev Mar 15 '16 at 22:24
  • @AntonKnyazyev but surely when computing the axis-angles for each _joint_ it would matter which was applied first right –  Mar 15 '16 at 22:55
  • it matters when applying some finite angles, sure, but for IK you just need velocities, which are computed based on the current axes, unaffected by any post-solver rotations. in any case though, if you employ Euler angles, you'd need to stick to some order. typically it's either x-y-z or z-y-x – Anton Knyazyev Mar 15 '16 at 23:19
  • ..obviously, it's best to use the same order that's used by the content creation tool your model was made in – Anton Knyazyev Mar 15 '16 at 23:22
  • If gimbal lock is your concern, you can always use a floating axis. At every step, you can assume your x, y, z axes are parallel to the world x, y, z and compute IK accordingly. – Gazihan Alankus Jul 26 '16 at 08:16
  • @GaziAlankus hmm, I see what you mean, but isn't IK easier with axes which are "natural" to the joint? IDK I'll need to read up. –  Jul 26 '16 at 08:32
  • It's the same kind of computation, really. But you can't enforce angle limits when using floating axes, for example. – Gazihan Alankus Jul 26 '16 at 10:44

0 Answers0