void drawEm() { background(0); // clear previous crap noFill(); // draw base lines plan_bline.drawLine(); el_bline.drawLine(); // fold line fold.drawLine(); // construction lines // connect perspective points stroke(50); line(p1.x, p1.z, p1.x, p1.y); line(p2.x, p2.z, p2.x, p2.y); line(p3.x, p3.z, p3.x, p3.y); line(p4.x, p4.z, p4.x, p4.y); // stereotomic perspective lines plan_p1b2.drawLine(); plan_p1t2.drawLine(); plan_p2b3.drawLine(); plan_p2t3.drawLine(); plan_p3b1.drawLine(); plan_p3t1.drawLine(); plan_p4b2.drawLine(); plan_p4t2.drawLine(); el_p1t2.drawLine(); el_p2t3.drawLine(); el_p3t1.drawLine(); el_p4t2.drawLine(); // connect points across fold stroke(50); line(b1.x, el_bline.height, b1.x, b1.y); line(b2.x, el_bline.height, b2.x, b2.y); line(b3.x, el_bline.height, b3.x, b3.y); line(b4.x, el_bline.height, b4.x, b4.y); line(t1.x, t1.z, t1.x, t1.y); line(t2.x, t2.z, t2.x, t2.y); line(t3.x, t3.z, t3.x, t3.y); line(t4.x, t4.z, t4.x, t4.y); // solid lines stroke(255); // base in plan beginShape(); vertex(b1.x, b1.y); vertex(b2.x, b2.y); vertex(b3.x, b3.y); vertex(b4.x, b4.y); vertex(b1.x, b1.y); endShape(); // base in elevation beginShape(); vertex(b1.x, el_bline.height); vertex(b2.x, el_bline.height); vertex(b3.x, el_bline.height); vertex(b4.x, el_bline.height); vertex(b1.x, el_bline.height); endShape(); // top in plan beginShape(); vertex(t1.x, t1.y); vertex(t2.x, t2.y); vertex(t3.x, t3.y); vertex(t4.x, t4.y); vertex(t1.x, t1.y); endShape(); //top in elevation beginShape(); vertex(t1.x, t1.z); vertex(t2.x, t2.z); vertex(t3.x, t3.z); vertex(t4.x, t4.z); vertex(t1.x, t1.z); endShape(); line(b1.x,el_bline.height, t1.x, t1.z); line(b1.x, b1.y, t1.x, t1.y); line(b2.x, b2.y, t2.x, t2.y); line(b2.x, el_bline.height, t2.x, t2.z); line(b3.x, b3.y, t3.x, t3.y); line(b3.x, el_bline.height, t3.x, t3.z); line(b4.x, el_bline.height, t4.x, t4.z); line(b4.x, b4.y, t4.x, t4.y); // draw control points noStroke(); rectMode(CENTER); // corner points fill(0,255,0); b1.drawPoint(); b2.drawPoint(); b3.drawPoint(); b4.drawPoint(); fill(255,255,0); t1.drawPoint(); t2.drawPoint(); t3.drawPoint(); t4.drawPoint(); // vanishing points p1.drawPoint(); p2.drawPoint(); p3.drawPoint(); p4.drawPoint(); }