Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Dan Heim on March 27, 2022 at 1:06 pm

    Need some help with a puzzling result. I’m trying to simulate the behavior of an unusual light I spotted in the night sky. It changed in size both horizontally and vertically, in a flickering kinda way, but remained generally circular. Been trying to duplicate that with wiggle. Here’s my code:

    WH = wiggle(random(0.1,0.2),1); // horizontal wiggle value in percent
    WV = wiggle(random(0.1,0.2),1); // vertical wiggle value in percent
    [WH[0],WV[1]] // this expression assigns separate values to the horizontal and vertical scales

    The object being wiggled is a circle that starts at a scale of 3% in both dimensions. At the start of the animation this generates scale values that differ only slightly from the original [3,3], like [2.8,3.2]. But the difference steadily increases as time goes by, and after 25 seconds I’m getting values like [3.8,4.1]. Something is definitely causing an asymmetry in the wiggle variation.

    Any insights greatly appreciated, thx.

    Dan Heim replied 4 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 27, 2022 at 2:16 pm

    Animating wiggle frequency that way can give you unpredictable results. This may help:

    http://www.motionscript.com/articles/speed-control.html#wiggle

  • Dan Heim

    March 27, 2022 at 5:19 pm

    Thanks for the tips. You have an incredibly valuable website for learning expressions. Been there often. After reading your comments about frequency I tried the following:

    FH = random(1,3); // assigns random horizontal frequency
    FV = random(1,3); // assigns random vertical frequency
    WH = value + wiggle(FH,1); // horizontal wiggle value in percent
    WV = value + wiggle(FV,1); // vertical wiggle value in percent
    [WH[0],WV[1]] // this line assigns separate values to the horizontal and vertical scales

    That fixed the problem, and the shape is now fluctuating in scale in a way that simulates what I saw in the sky. No more divergence from original size near the end of the comp.

    I suspect what happened originally might have been a “random walk” away from the original values that somehow accumulated positive changes. Perhaps in a longer comp things may have eventually returned to normal. Not sure. But what I have now does the trick. And I didn’t need to integrate. Thanks again!

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