Skip to main content
Participating Frequently
September 9, 2022
Question

Code wiggler

  • September 9, 2022
  • 3 replies
  • 578 views

Hi guys, I am trying to recreate the wiggler function (which you can find window - wiggler) to add some more features to it, but I cannot wrap my head around the math behind it. Can anyone advise in what direction should I be looking?

This topic has been closed for replies.

3 replies

Mylenium
Legend
September 10, 2022

You may be defeating your own intentions by not calculating the actual noise based on time and slicing up the time beforehand. That would already quantize the result and produce a different look.As per your graphs you are also not handling the keyframe interpolation and the sub-harmonies/ sub-octaves, which kind of is the point why wiggle() sometimes looks as it does when a result gets sampled. Again, I think your pre-time-slicing is the biggest issue here.

 

Mylenium

Participant
September 9, 2022

There is not much match in the wiggle function? I works like this: wiggle(a, b), where a is the number of times you want your object to move per second and b is the value your object is allowed to move (both positive and negative) from the object's initial value.

Participant
September 9, 2022

I meanr "math" not "match".

Participating Frequently
September 10, 2022

I think you misunderstood the question, I am trying to figure out the exact formula of the wiggler effect. I know how the wiggler() expression works, it has 5 parameters: wiggle(freq, amp, octaves, amp_mult, time)

Mylenium
Legend
September 9, 2022

You would need to be much more specific and explain what you are actually struggling with. The wiggle() stuff is simply a 3D Perlin noise whose parameters you manipulate and that's it.

 

Mylenium

Participating Frequently
September 10, 2022

My final goal is to create a script that will have the same functions as the after effects’ builtin wiggler plugin (window - wiggler), but I want to add some more features to it, like storing wiggler’s settings to presets to quickly apply it later.

So to recreate it I am trying to understand the math behind the effect.  The plugin divides every second between 2 keyframes to N(Frequency parameter) time ranges and between each of the ranges the property’s value goes from 0 to up to Magnitude value following some type of sinusoidal path. For example between 2 position keyframes: first is at the 0 seconds and position 100, 540 and the second is at the 1st second and again at position 100, 540; I apply wiggler with freq = 10 and Mag = 20px every frame the values will go:


x: 100.00 y: 540.00

x: 109.87 y: 553.37

x: 105.15 y: 549.39

x: 101.56 y: 546.38

x: 92.75 y: 541.25

x: 98.66 y: 547.14

x: 109.84 y: 561.73

x: 112.47 y: 554.50

x: 114.51 y: 548.13

x: 118.88 y: 539.86

x: 115.24 y: 535.69

x: 108.82 y: 534.84

x: 113.02 y: 533.21

x: 111.50 y: 522.73

x: 94.42 y: 520.88

x: 90.61 y: 525.99

x: 78.58 y: 538.05

x: 86.86 y: 536.36

x: 97.61 y: 545.02

x: 103.10 y: 559.63

x: 107.31 y: 556.57

x: 108.77 y: 555.00

x: 117.19 y: 559.23

x: 124.37 y: 553.85

Yes, this looks like Perlin noise combined with sinusoid values, but I want somehow recreate the exact formula. There is also a “jagged” noise type, which I have no idea what it is

Participating Frequently
September 10, 2022

I forget to attach some screenshots to better understand the examples