CodingTrain / CodingTrain/Suggestion-Box

CC - Turn this in to a useful function? looping noise for CC-36

Open
#246 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

inspired by CC 36 and made up some looping noise code this could also be used to fix the sheering issue you were getting in the flow field CC if you went through the effort of mathematically generating a torus (if you don't mind slight puckering) which isn't too hard I'm just lazy

hope it helps!

P.S. you could use math to dynamically create the circle based on how many segments the user wants and how long they want each segment

`void setup(){
size(500,500);
}
void draw(){
background(0);
fill(0,255,0);
beginShape();
FloatList array=new FloatList();
for (float a = 0; a <= TWO_PI; a += TWO_PI/50) {
float r =10;
float x=r*cos(a);
float y=r*sin(a);
vertex(x+width/2, y+width/2);
array.append(noise((x*.05)+50,(y*.05)+50));
}

//toff++;

endShape();
noStroke();
for(int x=0;x<250;x++){
for(int y=0;y<250;y++){
fill(map(noise((x*.05)+50,(y*.05)+50),0,1,0,255),255/2);
rect(x*2,y*2,2,2);
}
}
stroke(255,0,0);
for(int x=0;x

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.