Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Searching a way to "rotate" position with a angle controller

  • Searching a way to "rotate" position with a angle controller

    Posted by Clement Dubois on February 1, 2022 at 3:26 pm

    Hi ! 👋

    I am currently working on a animation, and I looking for an expression to link my position to an angle controller.

    By editing the angle controller I want the position to “track the angle”, as You can see on the image, with the black text equal to the angle of the controller :

    I tried some code à found here, but none of them worked :/

    I don’t know if it is possible, but i could save me hours of work !

    Clément.

    Clement Dubois replied 4 years, 3 months ago 2 Members · 4 Replies
  • 4 Replies
  • Filip Vandueren

    February 2, 2022 at 1:56 pm

    The image wasn’t included…

    do you mean something based on trigonometry ?

    Like:

    a=degreesToRadians(45);

    pos = [Math.cos(a),Math.sin(b)]*100;

  • Clement Dubois

    February 3, 2022 at 4:42 am

    Hi Filip,

    Yes the image is missing…

    <div>I think it is the kind of code I am looking for, maybe the image will help you.</div>

  • Filip Vandueren

    February 3, 2022 at 8:10 am

    Yes, this can be done with cos and sin, just subtract 90°, in Maths 0 degrees means the 3 o clock position.

  • Clement Dubois

    February 3, 2022 at 4:35 pm

    Thanks Filip ! After few tweaks I found this code and it worked fine !

    b = thisComp.layer("Null 1").effect("Angle Control")("Angle");
    a=degreesToRadians(b);
    pos = [Math.cos(a) , Math.sin(a)];

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