// Chaotic Icon Generator // By: John Gilbertson double i,p,q,x,y,z; double imgscale,scalex,scaley; double[] vars; int n,iterates,npixelx,npixely,nstartx,nstarty; double xnew,ynew; int[] colours=new int[256]; value[] values; BFont font; double fnxpix (double x) { return nstartx + (scalex * (x + imgscale)); } double fnypix (double y) { return npixely - (scaley * (y + imgscale)); } int lookup(color c) { for(int l=0;l<256;l++) { if(c==colours[l]) { return l; } } return -1; } void setup() { font=loadFont("Futura-Medium.vlw.gz"); textFont(font,18); vars=new double[6]; size(600,400); //={new value(0.0,12,12,50),new value(1.2,12,24,50)}; // colorMode(RGB,255,255,255); background(color(0,0,0)); noSmooth(); for(int l=0;l<256;l++) { colours[l]=color(l,l,l); } imgscale = 1.0; npixelx = width; npixely = height; nstartx = 200; x = .01; y = .003; n = 4; iterates = 1; vars[3] = -1.8; //lambda vars[0] = 2; //alpha vars[1] = 0; //beta vars[2] = 1; //gamma vars[4] = 0; //omega scaley = npixely / (2 * imgscale); scalex = (npixelx - nstartx) / (2 * imgscale); values=new value[5]; values[0]=new value(0,20,20,100); values[1]=new value(1,20,50,100); values[2]=new value(2,20,80,100); values[3]=new value(3,20,110,100); values[4]=new value(4,20,140,100); } void loop() { for(int lp=0;lp<100000;lp++) { double zzbar = x * x + y * y; p = vars[0] * zzbar + vars[3]; double zreal = x; double zimag = y; for(int i = 1;iwidth || yp<0 || yp>height)) { color c=pixels[xp+(yp*width)]; int d=lookup(c); if(d<255) { pixels[xp+(yp*width)]=colours[d+1]; } } // set(xp,yp,c+color(1,1,1)); } drawMenu(); } void mousePressed() { x = .01; y = .003; background(0); int xp=mouseX; int yp=mouseY; for(int l=0;l=xpos && xp<=xpos+10 && yp>=ypos && yp<=ypos+20) { vars[val]+=0.01; } if(xp>=xpos+ourWidth && xp<=xpos+10+ourWidth && yp>=ypos && yp<=ypos+20) { vars[val]-=0.01; } } }