Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Bezier curve made from four null layers

  • Bezier curve made from four null layers

    Posted by Patrick Deen on August 4, 2007 at 8:43 pm

    I found exactly what I need at Dan Ebberts’ AE expressionslab.
    The thing is I can use it as is but I’d like to understand what’s going on in the formula.

    Can someone give some insight on the inner workings of this formula?
    It is probably derived from an excisting math-formula (like the abc)
    A link to the math itself would be sufficient also…

    // Dans’ code;

    N1 = thisComp.layer(“Null 1”);
    N2 = thisComp.layer(“Null 2”);
    N3 = thisComp.layer(“Null 3”);
    N4 = thisComp.layer(“Null 4”);

    p0 = N1.position;
    p1 = N2.toWorld(N2.anchorPoint);
    p2 = N3.toWorld(N3.anchorPoint);
    p3 = N4.position;

    c = 3*(p1 – p0);
    b = 3*(p2 – p1) – c;
    a = p3 – p0 – c – b;

    t = index/(thisComp.numLayers – 3);
    ((a*t +b )*t + c)*t + p0 // THIS IS WHAT I’M TALKING ABOUT

    THNX in advance. And Dan… A big thanks for the bezier-curve script, superb!

    PS: My use for this expression is a plant like object made out of segments. The fact that the segments stick to the beziercurve makes it possible to move the curve in 3Dspace. VERY NICE !

    Unlike the snake and follow setups where the leader needs to be in constant motion to avoid the slaves/followers from catchingup. And you can’t animate that curve… only follow it.

    Patrick Deen replied 19 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 4, 2007 at 10:17 pm

    I have to admit that I never tried to figure out how it works, I just accepted the formulas and verified that they do work. There’s info about the math from a lot of different sources. Here are a couple:

    https://www.moshplant.com/direct-or/bezier/math.html

    https://en.wikipedia.org/wiki/B%C3%A9zier_curve

    Dan

  • Patrick Deen

    August 5, 2007 at 6:32 am

    Thank you Dan,

    And such a fast reply 🙂 great.

    I’m not saying I’m a math genius or anything but with a little effort it’s possible to understand (if only a bit) what’s going on instead of just copypasting (I hate it when I have to do that). Although these script were ment to help others, I can’t help but feel like I’m stealing someones script if I don’t put in the effort to learn from it.

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