Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects “Stranger Than Fiction” swinging on a Hinge effect

  • “Stranger Than Fiction” swinging on a Hinge effect

    Posted by Dorian on June 7, 2007 at 11:58 am

    I’m looking for info on how to do the “Objects-on-a-hinge” sort of effect that I’ve seen in commercials and more specifically in the first 10-minutes of the movie “STRANGER THAN FICTION”. I know how to make an object swing in on an Anchor point; its the natural-looking “back-and-forth” motion that I want to simulate.

    Dorian replied 18 years, 11 months ago 3 Members · 3 Replies
  • 3 Replies
  • Steve Roberts

    June 7, 2007 at 12:32 pm

    You might want to check out the expressions COW and look for a “damping” expression.

    Or you could do it manually by keyframing and easing the rotation values.

  • Mike Clasby

    June 8, 2007 at 2:21 am

    This handy-dandy expression by Dan Ebberts (refined minutes ago on the Cow Expression forum) will do what you want. Just add a marker wherever you want the dampening swing. Put the expression on X Rotation of a 3D layer and where you set a marker, SWING-SWing-swing-rest. Adjust amp, freq and decay to taste. The numbers below work good for about a second to settle down.

    amp=70; //amplitude (pixels)
    freq=2; //frequency (cycles per second)
    decay=2.5; //decay time (seconds)

    // find previous marker

    n = 0; // assume haven’t reached a marker yet
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n–;
    }
    }

    if (n > 0) t = time – marker.key(n).time else t =0;
    a = amp*Math.sin(freq*t*Math.PI*2)/Math.exp(decay*t);
    if ((n > 0) && ((marker.key(n).index % 2) == 0)) a = -a;
    a

    It is setup so that the text will swing away from the viewer, looking correct if the first rotation of the text if fall down and toward the viewer. Then the next marker will make the text kick out the other way, toward the viewer, then next marker away, so you can alternate the rotations and swing-dampening. You’ll see what I mean.

    If you want the dampen to always kickout in the same direction then change the last three lines to this:

    if (n > 0) t = time – marker.key(n).time else t =0;
    a = amp*Math.sin(freq*t*Math.PI*2)/Math.exp(decay*t);
    a

    Or to this:

    if (n > 0) t = time – marker.key(n).time else t =0;
    a = amp*Math.sin(freq*t*Math.PI*2)/Math.exp(decay*t);
    – a

    depending on which way you want to kickout (the same every time).

  • Dorian

    June 8, 2007 at 11:58 am

    Thanks very much! This looks like what I need.

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