Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions a roaming rotating square

  • a roaming rotating square

    Posted by Simon Francois on December 5, 2017 at 10:21 pm

    Hi all, and thanks in advance for your help. I’m trying to achieve soemthing but cannot find ways to crack it up.

    What I would like to have is a square moving itself by rotating of 90° every second. The script I’m using for that is:

    segDur = 1;
    seed = Math.floor(time/segDur);
    segStart = seed*segDur;
    seedRandom(seed,true);
    startVal = Math.round(random(1))*90;
    seedRandom(seed+1,true);
    endVal = Math.round(random(-1, 1))*90;
    ease(time,segStart,segStart + (segDur/2), startVal, endVal);

    So it can move either 90° left, or right, or stay still.

    I want to add to that the fact that its anchor point is also randomly placed on any of its vertices every second, and thus its motion is more unpredictable. But then, I also want it to take into account its new position, and move in that fashion within the frame of the composition.

    I’m not sure if this is clear, but here are examples of what I want to do (handmade animation made without expressions):
    11934_squarerandomrotationexample.mp4.zip

    And what I could do so far:
    11935_squarerandomrotationtryout.mp4.zip

    Thanks a million for your help.
    —-
    Simon

    Simon Francois replied 8 years, 7 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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