# Universal pose algorithm?

• Having just resumed investigation of a previously (temporarily) abandoned project, to directly read DS .duf and .dsf files and apply their contents to a Poser scene (whether prop or figure definition or pose applied to the current selection) I rediscovered the root cause (as I believe it to be) of discrepancies between poses designed for one figure being applied to another for which it was not designed.

I've made python scripts before which took a pose applied to a figure and adjusted it to match the limb and torso attitudes of the figure for which the pose was designed. Up until now, those adjustments had merely been to add offsets to some of the rotations, which seemed to adequately compensate for default A-pose figure poses applied to figures whose default was a T-pose. I had even gone to the trouble of adding extra, dummy actors to the target figure, to account for and correctly handle rotations of intermediate body parts like "pelvis", "abdomen2", "chest2", "neck2", etc., so that the poses could be directly applied to the target figure without losing the pose information relevant to missing body parts. The trouble is, now that I'm looking at a larger test sample of poses, I find occasional ones where the root actor (Body) or hip or pelvis is not facing along the z-axis, or nearly so, and seeing large discrepancies.

[Image placeholder] Example G3F (mesh) to V4 Pose.

It's only just occurred to me to look closely at the built-in rotation orders of those actors, and discovered, to my horror, that the original and target figures' actor rotation orders did not always match! A quick search found an online 3D Rotation Converter which gave me a simple way to confirm that converting the Euler angles of the original figure's actors to the target figure's rotation order did correct for the discrepancies (ignoring the impossibility of exactly matching a pose between figures with different limb lengths - you can match the angles or the extremities' end-points, but not both).

This success raised the question, which I ask here, since I've had limited success using Poser's Universal Pose feature, does anyone know if Poser incorporates this angle-order conversion in it's Universal Pose application algorithm?

• Alas! I also find that many poses are designed with no translations or rotations applied to the figures' Body (root actor) and everything assigned to the hip (or pelvis). In many instances, a rotation of the middle axis (second of the three axes in the rotation order hierarchy) at or close to 90 degrees leaves that actor in or near gimbal lock (where large rotations of both the other axes are required to effect small adjustments of the "lost" axis - one degree of freedom has been sacrificed).

I propose that a "better" solution (IMHO) is to always apply the majority of X and Z translations, and Y rotations to the root actor, leaving Y translations, and X & Z rotations for the hip (or pelvis) actor alone (with only sub-degree or small adjustment translations left for the other hip axes). That eliminates any possibility of gimbal lock, as the hip rotations have no effect on the Body axes. I note that there can be other circumstances where the user needs the figure to perform some in-place rotation about the Y-axis of the hip, and my suggestion there (assuming the figure does not already have separate hip and pelvis actors [dummy actors that distribute their applied rotations to adjacent physical actor do not count here] is to parent the entire figure to a grouping object, and use that to set the Y-axis of the root actor at the desired attitude.

I suspect that the original Poser Devs have thoroughly explored all of these scenarios, given the plethora of figure conforming options in evidence: Origins and EndPoints, for example.

None of this is any particular help to me in the course of attempting to develop intelligent algorithms for pose matching of disparate figures, except that it probably indicates that I need to abandon the concept of trying to calculate pose adjustment parameters, and instead derive the original figure's actor origins and endpoints (plus an orthogonal vector for orientation [perhaps a quaternion is appropriate here?]) and use those solely for pose matching of the target figure. [Much binding in the marsh to ensue...]