From: Jonathan Blow <jon@nu...> - 2003-11-21 01:54:31
> The bones are oriented along their local X axis, and each has a quaternion for its local rotation. What I do is "squash" the
rotated bone direction vector, projecting it onto the YZ plane (like a shadow), and see if it violates a 2D ellipse centered in the
local (0, 0) point.
I think there's a slight misconception here... if by the local (0, 0) point you mean
the origin of the bone rotation, then it doesn't make sense to constrain the rotation to an ellipse
that is centered on that point... that is the degenerate case.
The ellipse needs to be embedded in a plane that is offset from the origin of rotation.
At that point, the constraint has geometric meaning (some orientations result in vectors that
pass through the ellipse, others don't). And, it's straightforward to convert from 2d to3D in this
case since no information has been lost. (If the origin of your 2D coordinate system for the ellipse
is, say, 1 unit along the default pose of the bone, then it's easy to build transformation matrices
that take you there from 3D space, and back again).