float xmag, ymag, zmag = 0; float newXmag, newYmag, newZmag= 0; int Delay=7; int num = 23; double angle = 2*Math.PI/num; float xloc = 0; float yloc = 0; float r = 0; int count = 0; double value = 0; String display = "cos"; void setup() { size(600, 600); colorMode(RGB, 100); //background(90, 90, 90); r = width/3; value= width/3; } void mouseDragged() { if (pmouseX > mouseX) { value = value - 20; } else { value = value + 20; } } void mousePressed() { if ((mouseX >10) && mouseX < 25 && mouseY >10 && mouseY<25) { display = (display=="sin") ? "cos" : "sin"; } if ((mouseX >15) && mouseX < 40 && mouseY >10 && mouseY<25) { num ++; angle = 2*Math.PI/num; } } void loop() { background(0,0,0); stroke(40); fill(20); rect(10, 10, 10, 10); rect(24, 10, 10, 10); noFill(); fill(255,255,255); BFont metaBold; metaBold = loadFont("Univers45.vlw.gz"); count +=1; // translate(width/2, height/2, 0); //newXmag = mouseX/(float)(width) * TWO_PI; newYmag = mouseY/(float)(height) * TWO_PI; newXmag = count/(float)(width) * TWO_PI; //newXmag = count/(float)(value) * TWO_PI; newZmag = mouseX/(float)(height) * TWO_PI; float diff = xmag-newXmag; if (abs(diff) > 0.01f) { xmag -= diff/Delay; } diff = ymag-newYmag; if (abs(diff) > 0.01f) { ymag -= diff/Delay; } rotateX(ymag); rotateY(xmag); rotateZ(xmag/2); double rUse = 0; for (int ii=0;ii