/** * Mandel Path * by Xavier Gouchet (2008) * xavier.gouchet@gmail.com */ // aerea settings float top = 1.25; float bottom = -1.25; float left = -2.25; float right = 1.0; // mndlbrt settings int iter = 96; float step = 0.004; // display settings int width, height; // grids boolean[][] mset; // bg Image PImage bg; PFont fontA = createFont("Arial", 10); void setup(){ // Init frame settings width = (int) ( (right - left) / step ); height = (int) ( (top - bottom) / step ); size(width,height); background(0); mset = new boolean[width][height]; bg = new PImage(width,height); textFont(fontA,10); smooth(); // compute Mandelbrot set for (int i=0; i 2){ mset[i][j] = false; // colorize float c = ((iter-k)*96)/iter; color col = color(c,c,c); bg.set(i,j,col); break; } // decal Mx = Nx; My = Ny; } } } } void draw(){ background(bg); // N = Mē+ C float Cx = (mouseX * step) + left; float Cy = (mouseY * step) + bottom; float Mx = 0, My = 0, Nx = 0, Ny = 0; int Mi = mouseX, Mj = mouseY, Ni = 0, Nj = 0; // mandelbrot main loop for (int k = 0; k 2) break; // decal Mx = Nx; My = Ny; Mi = Ni; Mj = Nj; } }