Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Help needed with trig-related expression

  • Help needed with trig-related expression

    Posted by Pdebster on September 25, 2007 at 8:02 pm

    I’ve attached the start and end of the ‘Beam’ effect to 2 track points.

    What I’d like to be able to do is extend the beam through the end point by means of a slider, in effect, be able to move the end point along the line/angle originally cast by the two tracking points.

    Thanks very much, in the meantime I’ll give it a crack with the little trig I know

    Pdebster replied 18 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 25, 2007 at 8:40 pm

    AE will do the trig for you. You should be able to use the same expression for Starting Point and Ending Point, just swapping the track point references. For example, you could use something like this for Starting Point:

    myTrack = thisComp.layer(“tracked layer”).motionTracker(“Tracker 1”)(“Track Point 1”).attachPoint;
    otherTrack = thisComp.layer(“tracked layer”).motionTracker(“Tracker 2”)(“Track Point 1”).attachPoint;
    s = effect(“Slider Control”)(“Slider”);
    v = normalize(myTrack – otherTrack);
    myTrack + v*s

    And this for Ending Point:

    myTrack = thisComp.layer(“tracked layer”).motionTracker(“Tracker 2”)(“Track Point 1”).attachPoint;
    otherTrack = thisComp.layer(“tracked layer”).motionTracker(“Tracker 1”)(“Track Point 1”).attachPoint;
    s = effect(“Slider Control”)(“Slider”);
    v = normalize(myTrack – otherTrack);
    myTrack + v*s

    Dan

  • Pdebster

    September 25, 2007 at 8:59 pm

    Thanks again Dan, works perfectly – I’ve never seen ‘normalize’ – what a great tool to have!

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