PFont font; Draggable a,b; int scanCount = 0; String octantLocale = ""; void setup(){ size (400,400); a = new Draggable (100, 100, 10, #FFFF99, #00FF00, "ellipse", "point a"); b = new Draggable (120, 120, 10, #FFFF99, #00FF00, "ellipse", "point b"); font = loadFont("Kartika-25.vlw"); textFont(font,25); background (255); ellipseMode(CENTER); rectMode(CENTER); } void draw(){ background(0); grid(); loadPixels(); bline(a.x,a.y,b.x,b.y,#000000); a.draw(); b.draw(); a.update(); b.update(); fill(255); text("Bresenham algorithm pixel scanner",20,20); text(octantLocale,40,40); text("pixels encountered: "+scanCount,60,60); scanCount = 0; } void grid(){ stroke(0,0,255); for (int i = 0; i < width; i+=20){ line(0,i,width,i); line(i,0,i,height); } }