class Pair { float x,y; Pair (float x, float y) { this.x = x; this.y = y; } } float zoom = 1; ArrayList pairs = new ArrayList(); String dataLines[]; int currentIdx = 0; int drawCount = 100; int screenX = 500; int screenY = 300; float xtrans = 0; float ytrans = 0; float startX = 0; float startY = 0; void setup() { dataLines = loadStrings("lentes.txt"); for (int i=0; i 0) stroke(205,205,0,5); else stroke(255,0,0,5); strokeWeight(4); strokeCap(ROUND); point(x,y); } currentIdx = currentIdx+drawCount; // pintar coordenadas stroke(255,255); fill(255,255); rect(0,0,100,20); fill(0,255); float px = float(round(100*(mouseX-screenX/2)/zoom))/100; float py = -1 * float(round(100*(mouseY-screenY/2)/zoom))/100; text(px+":"+py, 5,10); } void mousePressed() { startX = mouseX; startY = mouseY; } void mouseDragged() { xtrans = xtrans + mouseX - startX ; ytrans = ytrans + mouseY - startY ; startX = mouseX; startY = mouseY; currentIdx = 0; background(255); redraw(); } void keyPressed() { if (key == 'z') { zoom = zoom * 2; } else if (key == 'x') { zoom = zoom/2; } currentIdx = 0; background(255); redraw(); }