Untitled
unknown
java
4 years ago
1.1 kB
13
Indexable
float step= .04f;
float noiseMax=20;
float t=0;
boolean looped=false;
boolean once;
void setup() {
size(640, 640);
noStroke();
background(0);
}
void draw() {
noStroke();
fill(0,20);
rect(0,0,width,height);
translate((width/2), (height/2));
float t2=0f;
for(int j =0;j<12;j++){
beginShape();
noFill();
stroke(200+(j*7),((j+1)*20));
strokeWeight((float)j/6f);
if(t%360==0 && frameCount>79){
print("Looped at "+ frameCount+"th frame");
looped= true;
}
once= true;
for(float a =0;a<TWO_PI;a+=step){
float xOff = map(cos(a),-1,1,0,noiseMax);
float yOff = map(sin(a),-1,1,0,noiseMax);
float r= map(noise ( cos((t2+cos( t *0.0174532925f )*3f)/5f) + xOff,sin((t2+sin( t *0.0174532925f)*3f)/5f)+yOff),0,1,100+(j*10),200+(j*10)) ;
float x = r* cos(a);
float y = r * sin(a);
vertex(x, y);
}
endShape(CLOSE);
t2+=2f;
}
t+=5f;
if(!looped&& frameCount>75){
save("frame"+frameCount+".png");
}
}Editor is loading...