xxxxxxxxxx
PImage cup;
//GifMaker gifExport;
boolean isLoop = true;
PFont myFont;
float SCREEN_BOTTOM = 0;
float SCREEN_TOP = 0 ;
int frames = 0;
int totalFrames = 300;
ArrayList<PVector> points = new ArrayList<PVector>();
void setup() {
size(500, 500);
//cup = loadImage("cup.png");
//gifExport = new GifMaker(this, "export.gif", 100);
//gifExport.setRepeat(0); // make it an "endless" animation
SCREEN_BOTTOM = height - height/16*3.5;
SCREEN_TOP = height/16*3.5 ;
rectMode(CENTER);
//String[] fontList = PFont.list();
//printArray(fontList);
}
//color orange = new color(#f3a34f);
void keyPressed() {
if (key==' ') {
isLoop = !isLoop;
}
}
void draw() {
background(#955f42);
if (!isLoop) {
noLoop();
}
// Code Here.
noFill();
pushMatrix();
translate(width/2, height/2);
selfbg();
popMatrix();
pushMatrix();
translate(width/2, height/2);
//logSpiral(0.99, 0.26);
pushMatrix();
noFill();
for (int i = 0; i < 13; i++) {
rotate(PI*5.1*sin(frameCount*0.030*mouseX/width%300));
logSpiral(0.77+i*8.8, 0.15, 365+i*-55 );
archiSpiral(3.92+i*27.4, 4.71+i*0, 382+i*-27);
}
popMatrix();
popMatrix();
// Code End.
}
void selfbg() {
for (int i = 0; i < 68; i++) {
fill(#512e1e, 243 + i*-6);
noStroke();
float r = (123*mouseX/width-100)+i*14;
ellipse(0, 0, r, r);
}
}
void archiSpiral(float a, float b, float opaque) {
strokeWeight(2.5+sin(a*b)*2.0);
stroke(#8c5b40);
int count = 21;
float angunit = PI/6;
beginShape();
// LINES TRIANGLES TRIANGLE_STRIP
// TRIANGLE_FAN QUADS QUAD_STRIP
for (int i = 0; i<count; i++) {
float theta = i*angunit;
float r = a + (theta*b);
ellipse(1.7*r*sin(theta), 2.0*r*cos(theta), 1, 1);
if (noise(i)>0.92) {
endShape();
beginShape();
}
curveVertex(r*sin(theta), r*cos(theta));
}
endShape(); //CLOSE
}
void logSpiral(float a, float b, float opaque) {
strokeWeight(1.4+sin(a*b));
stroke(#fffbb4, opaque);
int count = 161;
float angunit = PI/9;
beginShape();
// LINES TRIANGLES TRIANGLE_STRIP
// TRIANGLE_FAN QUADS QUAD_STRIP
for (int i = 0; i<count; i++) {
float theta = i*angunit;
float r = a*exp(theta*b);
//point(r*sin(theta), r*cos(theta));
pushMatrix();
rotate(PI/2*noise(i*0.1));
rect(r*sin(theta), r*cos(theta), 3, 3);
popMatrix();
curveVertex(r*sin(theta), r*cos(theta));
}
endShape(); //CLOSE
}