-
IK update (keeping the feet level)
Earlier this month there was a question about how to keep the feet level when using the revised IK expressions. I’ve been scratching my head for weeks over this. It seems like it should be really simple to just calculate the foot’s world orientation and rotate that amount in the opposite direction. But in trying to make that work, I’ve seen some unbelievably bizzare results from the expressions. I’ve come to the conclusion that when you create a complex chain of expressions like these, you have to watch out not to create an expression “loop” where, essentially, two expressions reference each other.
So, (if anybody’s still interested) I think I finally cracked it. What seems to work is to apply a Transform effect to the foot. For the Transform’s anchor point and position you need to apply this simple expression:
anchorPoint
Then apply this expression to the Transform’s rotation property:
v = toWorldVec([1,0,0]);
-radiansToDegrees(Math.atan2(v[1],v[0]))Dan