The Pixel as Property Process Book

Page 101

101

collection of x, y coordinates { // record x coordinate // record y coordinate

// constructor

// Point: a class Point float x; float y;

}

if (!done) return; if (key == ‘a’ || key == ‘A’) { curved = false; done = false; paths.add(new Path()); } if (key == ‘c’ || key == ‘C’) { curved = true; } if (key == ‘l’ || key == ‘L’) { curved = false; }

}

if((key == ‘S’) || (key == ‘s’)){ save(“picture1.tif”); println(“saved”);

}

if((key == ‘J’) || (key == ‘j’)) { showImage = true; curved = false; done = false; paths.add(new Path());

}

showImage = false; done = true; if (done) return; // otherwise Point _apoint = new Point(mouseX, mouseY); lastpath.addVertex(_apoint);

}

Point lastPoint() { if (tail<1) return null; //otherwise return vertices[tail-1]; }

}

noFill(); beginShape(); curveVertex(vertices[0].x, vertices[0].y); for (int i=0; i<tail; i++) { curveVertex(vertices[i].x, vertices[i].y); } curveVertex(vertices[tail-1].x, vertices[tail-1].y); endShape();


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.