Digital Landscape

final

When I think of landscape, I think of looking into the mind of someone and seeing how they process everything. For this project, I wanted to create a landscape of someone who’s obsessed with blood and killing.

Continue reading “Digital Landscape”

Advertisements

Animation Code

int counter;
float pupilW;
float pupilH;
float r;
float g;
float b;
float mouthX;
float mouthY;

void setup() {
size(300, 400);
smooth();
counter++;
}
void draw() {

counter = counter + 1;

r = random(255);
g = random(255);
b = random(255);

background(0,g,b);

//head
stroke(0);
fill(255);
ellipse(width/2, height/2, 200, 300);
ellipse(100, 180, 40, 40); // left eye
ellipse(186, 180, 40, 40); // right eye

fill(r,g,b);
ellipse(100, 180, pupilW, pupilH); // left pupil
ellipse(186, 180, pupilW, pupilH); // right pupil

if (pupilW < 40){
pupilW = pupilW + .5;
pupilH = pupilH + .5;
}
if (pupilW == 40){
pupilW = 0;
pupilH = 0;
}

fill(255);
ellipse(143, 280, mouthX, mouthY); // mouth
//shroom
noStroke();
fill(144,90,90);
rect(mouseX-5,mouseY,10,30);
fill(r,0,b);
arc(mouseX,mouseY,40,40,PI,TWO_PI);
if (counter==1){
mouthX = 0;
mouthY = 0;
} else if (counter>1 && counter<100 && mouthX<=50 && mouthY<=50){
mouthX = mouthX + .5;
mouthY = mouthY + .5;
} else if (counter>100 && counter<150 && mouthX>=10 && mouthY>=10){
mouthX = mouthX – 1;
mouthY = mouthY – 1;
} else if (counter>200 && counter<250 && mouthX<=50 && mouthY<=30){
mouthX = mouthX + 1;
mouthY = mouthY + .5;
} else if (counter>250 && counter<300){
mouthX = mouthX – .5;
mouthY = mouthY – .5;
}
}
void mousePressed(){
counter = 0;
}

Moving Shapes

Here is the code of an assignment for Interactive Authoring that deals with moving shapes, both interactive and non-interactive.

boolean click;
boolean button;
float r;
float g;
float b;
float a;
float circleX;
float circleY;
float circleW = 0;
float circleH = 0;
float rectX;
float rectY;
float rectW;
float rectH;
float triX1;
float triX2;
float triY1;
float triY2;

void setup(){

size(720,480);
smooth();

}

void draw(){

background(0,g,b);
frameRate(24);

r = random(255);
g = random(255);
b = random(255);
a = (100);
circleX = 360;
circleY = 240;
rectX = random(width);
rectY = random(height);
rectW = random(200);
rectH = random(200);
triX1 = 720;
triY1 = 480;
triX2 = 0;
triY2 = 480;

//rectangle
noStroke();
fill(r,0,b);
rect(rectX,rectY,rectW,rectH);

//triangles
fill(0,113);
triangle(0,0,0,480,triX1,triY1);
fill(255,113);
triangle(720,0,720,480,triX2,triY2);

//circle
noStroke();
fill(r,g,b);
ellipse(mouseX,mouseY,circleW,circleH);

if (click == true){

circleW = circleW + 2;
circleH = circleH + 2;

}

//black screen with text
if (button == true){
frameRate(2);
noStroke();
fill(0);
rect(0,0,720,480);
textSize(50);
fill(r,g,b);
text(“error”,596,473);
}

}

void mousePressed(){
click = true;
}

void keyPressed(){
button = true;
}

void keyReleased(){
button = false;
}

Coding Fixes

Fix 1:

void setup() {

size(1080,720);
smooth();

}

void draw() {

background(255);

ellipseMode(CENTER);
rectMode(CENTER);

stroke(0);
fill(175);
rect(mouseX,mouseY,20,100);
stroke(0);
fill(255);
ellipse(mouseX,mouseY-30,60,60);
fill(mouseX,0,mouseY);
ellipse(mouseX-19,mouseY-30,16,32);
ellipse(mouseX+19,mouseY-30,16,32);
stroke(0);
line(mouseX-10,mouseY+50,pmouseX-10,pmouseY+60);
line(mouseX+10,mouseY+50,pmouseX+10,pmouseY+60);

}

void mousePressed() {
fill(random(255),random(255),random(255));
textSize(90);
text(“Take me to your leader!”,0,200);
}

Fix 2:

void setup() {
size(200,200);
background(255);
}
void draw() {
}
void mousePressed() {
stroke(0);
fill(175);
rectMode(CENTER);
rect(mouseX,mouseY,16,16);
}
void keyPressed() {
background(255);
}

Fix 3:

color RanColor;
boolean goCrazy;

void setup() {
size(300, 300);
RanColor = color(200, 10, 189);
}

void draw() {
background (RanColor);
if (goCrazy) {
RanColor = color(random(255), random(255), random(255));
}
}

void mousePressed() {
goCrazy = true;
}

void mouseReleased() {
goCrazy = false;
}

Fix 4:

int circleX = 0;
int circleY = 100;
void setup() {
size(200,200);
}
void draw() {
background(255);
stroke(0);
fill(175);
ellipse(circleX,circleY,50,50);
circleX = circleX + 1;
}

Fix 5:

float r;
float g;
float b;
float a;
float diam;
float x;
float y;
void setup() {
size(720,480);
background(0);
smooth();
}
void draw() {
// Fill all variables with random values
r = random(255);
g = random(255);
b = random(255);
a = random(255);
diam = random(20);
x = random(width);
y = random(height);
// Use values to draw an ellipse
noStroke();
fill(r,g,b,a);
ellipse(x,y,diam,diam);
}

Christina’s Geometric World

Screen Shot 2016-09-07 at 12.07.56 PM.png

zzz Christinas World Andrew Wyeth large image.jpg

Here is a interpretation of Andrew Wyeth’s Christina’s World using Processing 3. Below is the code used to create this image.

void setup(){
size (720,480);
background(104,148,189);
}

void draw(){

//sky
noStroke();
fill(104,148,189);
rect(0,0,300,480);

//field
noStroke();
fill(149,131,92);
rect(0,150,1080,720);
fill(132,109,92);
ellipse(475,194,492,146);

//house
noStroke();
fill(61);
rect(536,101,50,50);
fill(83);
rect(585,101,60,50);
rect(602,71,9,24);
rect(625,70,14,25);

//house roof
fill(73);
rect(567,81,78,21);
fill(64);
triangle(538,101,586,102,567,81);

//shacks right
fill(47);
rect(649,128,25,22);
fill(105);
rect(686,139,12,11);

//middle shack
fill(89);
rect(188,119,50,31);
triangle(238,122,222,99,207,120);

//girl

//arm left
fill(252,230,187);
rect(393,344,58,10,1);

//legs
fill(252,192,226);
triangle(293,354,294,404,244,405);
fill(255);
rect(221,390,46,15);
fill(0,0,0);
rect(211,375,14,30);

//body
fill(252,192,226);
rect(365,316,32,46);
rect(357,345,40,50);
rect(293,354,100,50);

//arm right
fill(252,230,187);
rect(390,345,11,61,1);

//head
fill(42);
ellipse(391,295,44,54);
triangle(355,350,408,313,372,284);

}