This page is not finalized.
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:
void setup() {
size(300,300);
frameRate(120);
}
void draw() {
background(255);
ellipse(width/2 + random(-3, 3), height/2 + random(-3, 3), 50, 50);
}
Modify this program to achieve the following goals:
Save this program in your
homework01
folder under the sketch name
ShakingCircle
.
Consider the following program, which animates a changing triangle:
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) );
}
Notice that this animation is not very interesting, since it usually involves a very flat
triangle. Modify this program to achieve the following goals:
Save this program in your
homework01
folder under the sketch name
ChangingTriangles
.
Consider the following program, which animates a shaking quadrilateral:
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));
}
Modify this program to achieve the following goals:
Save this program in your
homework01
folder under the sketch name
Quadrilaterals
.