Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Constraint movement along X, Y and Z axis

  • Constraint movement along X, Y and Z axis

    Posted by Rowan De geus on June 21, 2019 at 9:45 am

    Hello reader,

    I am struggling creating an expression to constrain movement of a layer to a certain angle. I found this isometric expression which works great:

    pos = transform.position;
    x = effect(“X Movement”)(1);
    z = effect(“Z Movement”)(1);
    y = effect(“Y Movement”)(1);
    [x*Math.sqrt(3) + z*Math.sqrt(3) + pos[0], -x + z + y + pos[1]];

    But how can I adjust this to match angles of 190 and 140?

    EDIT: Found it for the X axis (thanks Dan):

    x = effect(“X Movement”)(“Slider”);
    a = 190;
    y = -x*Math.tan(degreesToRadians(a));
    value + [x,y]

    But how to adjust this so Z has an angle of 140?

    Michael Szalapski replied 6 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Rowan De geus

    June 21, 2019 at 11:07 am

    Got it:

    pos = transform.position;
    x = effect(“X Movement”)(1);
    z = effect(“Z Movement”)(1);
    y = effect(“Y Movement”)(1);
    a1 = 190;
    a2 = 40;
    [x + z + pos[0], -x*Math.tan(degreesToRadians(a1)) + z*Math.tan(degreesToRadians(a2)) + y + pos[1]];

  • Michael Szalapski

    June 28, 2019 at 5:05 pm

    Thank you for sharing your solution!

    – The Great Szalam
    (The \’Great\’ stands for \’Not So Great, in fact, Extremely Humble\’)

    No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.

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