Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression attach Displacement Map Values to an Angle Control effect

  • Expression attach Displacement Map Values to an Angle Control effect

    Posted by Jesse Richards on April 7, 2020 at 5:01 pm

    Hi

    I’m not sure if it’s possible but I’m trying to get the direction in which my Displacement Map is displacing to be linked to an Angel Control effect slider.

    So if the Angle Control was set at 90 degrees then my Displacement Map values would be:

    Max Horizontal Displacement: 100 (any positive number really)

    Max Vertical Displacement: 0

    And if it was set to 180 degrees it would be

    Max Horizontal Displacement: 0

    Max Vertical Displacement: 100

    and so on….

    Any ideas?

    Thanks in advance

    Jesse

    Jesse Richards replied 6 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Darby Edelen

    April 7, 2020 at 5:54 pm

    Sure, for your example you’d apply this to the horizontal displacement:

    amp = 100;
    angle = 45 //replace with angle control value here
    amp * Math.cos(degreesToRadians(angle)- Math.PI/2);

    And vertical displacement:

    amp = 100;
    angle = 45 //replace with angle control value here
    amp * Math.sin(degreesToRadians(angle)- Math.PI/2);

    I’ve written these from memory and haven’t tested them, so let me know if something doesn’t work.

    Darby Edelen

  • Jesse Richards

    April 7, 2020 at 6:30 pm

    Incredible! It works perfectly thanks so much.

    Jesse

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