PImage img1, img2; MorphPen morphPen; MorphSurface morphSurface; void setup() { size(372,253,P3D); img1 = loadImage("morph1_1.jpg"); img2 = loadImage("morph1_2.jpg"); morphPen = new MorphPen(80.0); morphSurface = new MorphSurface(img1,img2); } void keyPressed() { if (key=='1') { morphSurface = new MorphSurface(loadImage("morph1_1.jpg"),loadImage("morph1_2.jpg")); } else if (key=='2') { morphSurface = new MorphSurface(loadImage("morph1_2.jpg"),loadImage("morph1_1.jpg")); } else if (key=='3') { morphSurface = new MorphSurface(loadImage("morph2_1.jpg"),loadImage("morph2_2.jpg")); } } void draw() { if (mousePressed) morphPen.drawOnto(morphSurface); morphSurface.update(); image(morphSurface,0,0); }