Your instructor will assign one or more of the following problems. Submit all appropriate
files for grading, including code files, screen captures, supplemental files (e.g., image files),
and text files. Group them all together in a directory called homework01
.
Create a new Processing program that displays two different images in some way.
Consider the following program, which animates a “shaking” circle:
Modify this program to achieve the following goals:void setup() { size(300,300); frameRate(120); } void draw() { background(255); ellipse(width/2 + random(-3, 3), height/2 + random(-3, 3), 50, 50); }
Save this program in your homework01
folder under the sketch name ShakingCircle
.
Consider the following program, which animates a changing triangle:
Notice that this animation is not very interesting, since it usually involves a very flat triangle. Modify this program to achieve the following goals:void setup() { size(300,300); frameRate(120); } void draw() { background(255); triangle(width/4 + random(-3, 3), height/4 + random(-3, 3), width/2 + random(-3, 3), height/2 + random(-3, 3), width*3/4 + random(-3, 3), height*3/4 + random(-3, 3) ); }
Save this program in your homework01
folder under the sketch name ChangingTriangles
.
Consider the following program, which animates a shaking quadrilateral:
Modify this program to achieve the following goals:void setup() { size(300,300); frameRate(10); } void draw() { background(255); quad(width/2 + random(-20,20), 2.5*height/6 + random (-20,20), 5*width/6 + random(-20,20), height/2 + random (-20,20), width/2 + random(-20,20), 3.5*height/6 + random(-20, 20), height/6 + random(-20,20), height/2 +random(-20,20)); }
Save this program in your homework01
folder under the sketch name Quadrilaterals
.