PFont fontt; float counter = 0; float max_diagonale = 0; // sqrt(width*width/4 + height*height/4); float anzahl_streifen = 10; float verhaltnis_weis_schwarz = 1; float kontrast_weis_schwarz = 10; float spiralig = 0; float quadratisch = 1; float rund = 0; float qua_gegenlaufig = 1; float geschwindigkeit = 20; float mx; float my; float []winkel; ui user_interface; parameter []para; void setup() { size(500, 500, P2D); fontt = loadFont("DejaVuSansMono-Bold-10.vlw"); textFont(fontt, 10); textMode(SCREEN); // (50,5) user_interface = new ui(10,5); user_interface.display("Welcome to strudel, for help please press '?'"); max_diagonale = sqrt(width*width/4 + height*height/4); //precalculate angle information! winkel = new float[height*width]; for(int x=-int(width/2); x=0) winkel[i] = 0.25 + 0.25 * atan(x/(y+1e-15))/(PI/2); else winkel[i] = 0.75 + 0.25 * atan(x/(y+1e-15))/(PI/2); } } //initialisate parameters para = new parameter[9]; para[0] = new parameter("contrast", "for good antialiaising use 15", parameter.CONSTANT, 15); para[1] = new parameter("ratio black and white", "ratio > 1 means there is more black than white", parameter.CONSTANT, 1); para[2] = new parameter("speed", "also negativ speed is possible!", parameter.CONSTANT, 10); para[3] = new parameter("number of stripes", "more than 100 is also a good effect", parameter.CONSTANT, 10); para[4] = new parameter("rect", "connected to round", parameter.MOUSEY, 0.01, 2.5, 2, 3); para[5] = new parameter("round", "connected to rect", parameter.MOUSEX, 0.01, 2.5, 2, 4); para[6] = new parameter("spiralig", "hmmmmmmm,.. just test it!", parameter.CONSTANT, 5); para[7] = new parameter("angle", "you can turn the whole image!", parameter.CONSTANT, 0); para[8] = new parameter("phase shift", "phase shift of the three colors red green and blue", parameter.CONSTANT, 3); // para[8] = new parameter("round", "connected to rect", parameter.CONSTANT, 1); } void draw() { background(255); loadPixels(); float p_contrast = para[0].calculate_and_return(); float p_ratio = para[1].calculate_and_return(); float p_speed = para[2].calculate_and_return(); float p_stripes = para[3].calculate_and_return(); float p_rect = para[4].calculate_and_return(); float p_round = para[5].calculate_and_return(); float p_spiralig = para[6].calculate_and_return(); float p_angle = para[7].calculate_and_return(); float p_phase_shift = para[8].calculate_and_return() + 0.00001; //println(para[0].value); float dreh_winkel = 45; float kontrast_schwarz_weis_incl = 128 * p_contrast; float factor_rect = (p_rect / (abs(p_round)+abs(p_rect))) * p_stripes*TWO_PI/(0.5*(width+height)); float factor_round = (p_round / (abs(p_round)+abs(p_rect))) * p_stripes*TWO_PI/max_diagonale; float spiralig_incl = TWO_PI * p_spiralig; float pre_cos = cos( p_angle/180 * PI); float pre_sin = sin( p_angle/180 * PI); counter = counter + PI/p_speed; if (counter>2*PI) counter = counter- (2*PI); else if (counter < 0) counter = counter + (2*PI); float mx; float my; float pre_winkel; int colorr; int colorg; int colorb; int j; int y; for(int x=-int(width/2); x