Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position relative to rotation

  • Position relative to rotation

    Posted by Ross Mcdowell on August 5, 2016 at 6:41 pm

    Hello!

    I have a null layer which contains tracking data for position and rotation. But I want to be able to attach this null to a ‘Point Control’ so I can adjust the position of the null layer.

    However, if the null is rotated 45 degrees, and I change the Y value of my point control, the null layer moves up and down relative to the composition. But I want it to move up and down relative to the rotation of the null.

    How is this possible?

    Thank you!

    thisComp.layer("FEATURES_TRACK").effect("Chin")("Point")+thisComp.layer("FEATURES_ADJUSTMENTS").effect("Chin")("Point");

    Ross McDowell
    Animation Student

    Kalleheikki Kannisto replied 9 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    August 6, 2016 at 7:22 am

    For example like this, when the point control is on the null layer.

    xd = effect("Point Control")("Point")[0];
    yd = effect("Point Control")("Point")[1];
    a = transform.rotation/180*Math.PI;
    xx = xd*Math.cos(a);
    xy = xd*Math.sin(a);
    yx = yd*Math.cos(a+Math.PI/2);
    yy = yd*Math.sin(a+Math.PI/2);

    transform.position + [xx, xy] + [yx, yy]

    There’s probably an easier way to do this with layer space transformations.

    Kalleheikki Kannisto
    Senior Graphic Designer

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