Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects A (kinda) IK question…

  • A (kinda) IK question…

    Posted by Erin Shelby on October 13, 2005 at 12:09 am

    I was using the tan2() expression to get an “arm” to point at a target…it looked simply like this (from http://www.jjgifford.com):

    this_point=position;
    that_point=this_comp.layer(“target”).position;
    delta=sub(this_point, that_point);
    angle=Math.atan2(delta[1], delta[0]);
    radians_to_degrees(angle);

    It worked great, the anchor point of the ‘arm’ was the shoulder. Okay, so Part 2 was to simply attach this arm to a body? Right? Wrong. The second it was parented to the body, everything went fairly ‘whack’. Is there anything I can do about this? Would this require the more complex IK solution from Ebberts/Motionscript? I don’t think so – because I don’t want the rotation of the arm (or position of the target) to effect the rotation of the ‘body’.

    -echo

    Dan Ebberts replied 20 years, 7 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    October 13, 2005 at 12:48 am

    Changing your first line to this should do the trick:

    this_point=toWorld(anchor_point);

    Dan

  • Erin Shelby

    October 13, 2005 at 6:52 pm

    Ah, thank you very much. And indeed it does work for the position, but – and stop me if it’s just not possible – but because it is the “body”, is there anways to affect the ‘arm’ rotation – while the arm still points at the target?

    As it stands right now, if I rotate the body, the arm rotates along with it, but no longer points at the target. I was thinking about turning on the 3d toggle and using the orientation as a quick fix…perhaps I shall try that right now…but your thoughts on he matter would be much appreciated.

    -eho

  • Dan Ebberts

    October 13, 2005 at 7:12 pm

    I think you just need to subtract the rotation of the body from your result, like this:

    radians_to_degrees(angle) – thisComp.layer(“body”).rotation;

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy