THREE.IK icon indicating copy to clipboard operation
THREE.IK copied to clipboard

Additional constraints

Open jsantell opened this issue 6 years ago • 5 comments

Currently, only IKBallConstraint is implemented, limiting the joint in by X degrees from its origin state. The FABRIK paper describes ways to implement more complex constraints with irregular cone areas and hinge constraints, but a bit stumped on how to implement that.

jsantell avatar Apr 23 '18 05:04 jsantell

Pole Vector constraints are pretty common for constraining the rotation plane of elbows and knees, etc. https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/CSCo-Pole-Vector-constraints-htm.html

bradley-newman avatar Apr 24 '18 04:04 bradley-newman

Pole vectors would be great. Would that be a constraint type, or be its own solver? In other words, could it work with either CCD or FABRIK handling the solving, with the pole vector influencing the result? It's been awhile since I've used pole vector constraints in Maya, but this should work beyond a 3-joint shoulder-elbow-hand configuration, yeah?

jsantell avatar Apr 26 '18 19:04 jsantell

I've only used them as constraints. Don't honestly know enough about the details of the rest of the things you mentioned.

bradley-newman avatar Apr 30 '18 02:04 bradley-newman

The naive way to implement "pole constraints"/attractors in FABRIK is to simply pull the joints toward the attractor a little bit before doing an IK solve. The joints preserve their "pulled" state even after the IK solve is run. The same thing can be done for a facsimile of gravity (where each joint is just offset downward a little bit every frame, in between solves).

CCDIK might do it by rotating all of the joints to face toward the attractor (well, in the direction of the base joint to the attractor) before doing a solve. The "pulled" state will still get preserved somewhat in CCDIK, but perhaps not as cleanly as it is in FABRIK.

zalo avatar Apr 30 '18 21:04 zalo

hey -- so I am using this library to procedurally animate a quadruped, and since the BallConstraint isn't really suitable for limb joints, I started to add a HingeConstraint.

Seems like it's working so far, I can post more details later in a PR, but just wanted to let you know~

sneha-belkhale avatar Mar 11 '19 12:03 sneha-belkhale