Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Wiggles at multiple scales

Explorer ,
Jul 11, 2010 Jul 11, 2010

The wiggle expression seems to have me stumped, so I'm not exactly sure how to integrate it into larger expressions, namely wiggling a wiggle.

Here's what I'd like to do:

I have an object in 3D space, and I wiggle its position:   wiggle(.3,1000)

What I want to do after that is wiggle the result of that path at a much higher frequency but lower amplitude (2,30 is a good starting point).

TOPICS
Expressions
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2010 Jul 11, 2010

Try this:

switchTime = 4; // switch at 4 seconds
if (time < switchTime)
  wiggle(.3,1000)
else{
  p1 = wiggle(.3,1000,1,.5,switchTime);
  p2 = wiggle(2,30,1,.5,switchTime);
  wiggle(2,30) - (p2-p1);
}

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2010 Jul 11, 2010

Oops!  Apologies for my imprecise language.  When I said "after" what I probably should have said as "in addition to".

Rather than hand off from one kind of wiggle to another, what I want to do is have two different wiggles operating simultaneously on different frequencies.

If I were using sine waves instead of pseudo-random wiggles, it might looks something like this formula:

y=sin(x)+(sin(10x)/10)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2010 Jul 11, 2010

How about this then:

switchTime = 4; // switch at 4 seconds
switchDur = .3;
w = wiggle(.3,1000);
if (time < switchTime)
  w
else{
  w2 = wiggle(2,30) - value;
  w + ease(time,switchTime,switchTime + switchDur,[0,0,0],w2)
}

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 12, 2010 Jul 12, 2010
LATEST

The optional 3rd and 4th values in the wiggle method can be used to add extra layers of higher frequency noise to the initial wiggle. The 3rd value is octaves, or the number of levels of noise added together (default = 1) and the 4th value controls how the amplitude of noise is multiplied for each octave (default = 0.5). So for example you could try wiggle(0.3,1000,2,0.5) and experiment with the last two values.

But to add two specific wiggles together you could do this:

lowFreq = position.wiggle(0.3,1000) ;

highFreq = position.wiggle(2,30)-value;

highFreq + lowFreq;

Paul
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines