Moving a letter's Points using perlin noise.
in
Contributed Library Questions
•
11 months ago
Im looking to animate the points retrieved using geomerative using perlin noise. Using Daniel Shiffman's Perling noise tutorial I have came up with the current code below. But this code is only drawing the sequence once because time is being increased once inside the for loop? How do increment the time more than once inorder to animate the points in a smooth fashion?
<---------code--------->
import geomerative.*;
RFont font;
void setup()
{
size(1000, 800);
smooth();
RG.init(this);
font = new RFont( "a.ttf", 500, RFont.CENTER);
frameRate( 200 );
}
void draw()
{
rect(0, 0, width, height);
fill(255, 255, 255, 50);
stroke(0);
strokeWeight(2);
translate(width/2, 500);
RGroup grp = font.toGroup("s");
RCommand.setSegmentLength(1);
RCommand.setSegmentator(RCommand.UNIFORMLENGTH);
RPoint[] pnts = grp.getPoints();
float r=random(-30, 30);
float time = 0.0;
float inc = 0.01;
for ( int i = 1; i < pnts.length; i++ )
{
float n=noise(time)*200;
point(pnts[i].x+n, pnts[i].y);
time += inc;
}
}
1