For my 6th recitation’s poster I chose the eyes topic. It pursues people to watch the show and looks pretty good. Also it contains three different basic shapes and can be modified for different tasks. For the begginer as me, it seemed to be a good option. I started with doing the 0mechanical part as functions and parametrs and later added decorations as colors and background.
For the first task I made this code :
float a = 0;
int b = 0;
int speed = 5;
PFont f;
void setup() {
size(1024, 768);
background(#F7FA7E);
f = createFont("Arial",32,true);
int gridSize = 40;
for (int x = gridSize; x <= width - gridSize; x += gridSize) {
for (int y = gridSize; y <= height - gridSize; y += gridSize) { noStroke(); fill(#FFCF6F); rect(x-1, y-1, 3, 3); stroke(255, 100); line(x, y, width/2, height/2); } }//background } void draw() { fill(random(0), random(200), random(100)); ellipse(110, b, 50, 50); a = a+speed; if (a>width){speed*= -1;}
if (a<0){speed *= -1;} b = b+speed; if (b>height) {speed *=-1;}
if (b<0){speed *=-1;}//moving circle fill(random(0), random(200), random(100)); rect(890, b, 50, 50); a = a+speed; if (a>width){speed*= -1;}
if (a<0){speed *= -1;} b = b+speed; if (b>height) {speed *=-1;}
if (b<0){speed *=-1;}//moving rect
mytext();
Eyes();
}
void Eyes() {
fill(255);
ellipse(480, 400, 50, 150);
ellipse(550, 400, 50, 150);
fill(0);
circle(480, 370, 40);
circle(550,370, 40);
fill(255);
rect(480,359,5,5);
rect(550,359,5,5);
//eyes
}
//make eyes, change font, decorate
void mytext(){
stroke(175);
textFont(f);
fill(0);
textAlign(CENTER);
text("IMA Fall 22 End-Of-Semester Show",width/2,160);
textAlign(LEFT);
text(" 8th floor",width/2,200);
textAlign(RIGHT);
text("December 16, 6-8pm ",width/2,240);}
The result:
For the first task I increased the amount of eyes and made a pattern of them (ypou can the the pattern result in the third code combined with the drawing concept):
background (#FAFF76);
size(800,800);
int gridSize = 30;
for (int x = gridSize; x <= width - gridSize; x = x+60) {
for (int y = gridSize; y <= height - gridSize; y = y+160) {
fill(255);
ellipse(x, y, 50, 100);
ellipse(x, y, 50, 100);
fill(0);
circle(x, y, 40);
circle(x,y, 40);
fill(255);
rect(x,y,5,5);
rect(x,y,5,5);
//eyes
}}
For the second task I made eyes to randomly appear on the screen with variour colors:
float a; float b; float c;
float x; float y;
PFont f;
void setup() {
size(1024, 768);
background(#F7FA7E);
background(#F7FA7E);
f = createFont("Arial",32,true);
}
void draw() {
fill (255);
rect(130, 90, 800, 200);
mytext();
Eyes();
}
void Eyes() {
fill(255);
x=random(1000);
y=random(786);
ellipse(x, y, 50, 150);
ellipse(x+100, y, 50, 150);
a=random(255);
b=random(255);
c=random(255);
fill(a, b, c);
circle(x, y, 40);
circle(x+100,y, 40);
fill(255);
rect(x,y,5,5);
rect(x+100,y,5,5);
//eyes
}
void mytext(){
stroke(175);
textFont(f);
fill(0);
textAlign(CENTER);
text("IMA Fall 22 End-Of-Semester Show",width/2,160);
textAlign(LEFT);
text(" 8th floor",width/2,200);
textAlign(RIGHT);
text("December 16, 6-8pm ",width/2,240);}
The result :
For the third task I added the drawing concept on the pattern. You can draw with your mouse here by eyes and you can change the background to the random colors by pushing the keyboard:
float x; float y; float z;
void setup () {background (#FAFF76);
size(800,800);}
void draw() {
Eyes();
}
void Eyes() {
int gridSize = 30;
for (int x = gridSize; x <= width - gridSize; x = x+60) {
for (int y = gridSize; y <= height - gridSize; y = y+160) {
fill(255);
ellipse(x, y, 50, 100);
ellipse(x, y, 50, 100);
fill(0);
circle(x, y, 40);
circle(x,y, 40);
fill(255);
rect(x,y,5,5);
rect(x,y,5,5);
//eyes
//eyes
}}
Eyes(mouseX, mouseY);
}
void Eyes(int a, int b) {
int gridSize = 30;
for (int x = gridSize; x <= width - gridSize; x = x+60) {
for (int y = gridSize; y <= height - gridSize; y = y+160) {
fill(255);
ellipse(a, b, 50, 100);
ellipse(a+100, b, 50, 100);
fill(0);
circle(a, b, 40);
circle(a+100,b, 40);
fill(255);
rect(a,b,5,5);
rect(a+100,b,5,5);
//eyes
//eyes
}}}
void keyPressed () {
background(x,y,z);
x=random(255);
y=random(255);
z=random(255);
}
Additionally, for the second and third task I added the text about the event to correlate together all the parts of homework. There were not much problems that I needed to solve. The main of them consist of that I know many concepts and ways to write codes, but I realised that I don’t know which of my lines are functions and which of them are parametrs. Also, we covered really small amout of coding in class, just the basics, so I needed to do a deep research and self-educate to use more difficult concepts in work. For all of the tasks I started to do the mechanical part of coding and later tried to add the decorations and colors. I am not good at design yet, also because of the limited ampunt of time which is divided for these recitations, but the main point of them is to get to know how to code. And with the coding experiencw later I will be able to develop my designing abilities on the basis of coding knoweledge.