Assignment #1 – A Ninja in PROCESSING

Processing Ninja

This is my first assignment for Introduction to Computational Media. I created this using PROCESSING. This assignment allowed me to experiment with stationary shapes, by using different colors I was able to create 2-d shading effects Please click through to see my source code.

 

 

Source code:

//Assignment 1 – ICM
//Nighttime Ninja – AJ LeVine

//document setup
void setup(){
size(1024,768);
PImage img;
img=loadImage(“mountain.jpg”);
background(img);
}

void draw(){

//bandana-tie
fill(200, 0, 0);
triangle(562, 70, 510, 10, 612, 10);

//head
fill(25, 25, 25);
ellipse(512, 300, 700, 550);

//face-opening
fill(250, 236, 172);
ellipse(512, 250, 600, 250);

//bandana
fill(200, 0, 0);
rect(200, 110, 625, 60, 100, 100, 10, 10);

//eyeslids
fill(180, 165, 115);
ellipse(350, 250, 175, 100);
ellipse(650, 250, 175, 100);

//eyes
fill(255, 250, 235);
ellipse(350, 250, 175, 75);
ellipse(650, 250, 175, 75);

//mouth
//fill(7, 7, 7);
//arc(510, 460, 150, 20, 0, PI, PIE);

//nose
fill(180, 165, 115);
ellipse(490, 338, 10, 5);
ellipse(525, 338, 10, 5);

//eyeballs
noStroke(); //why is this effecting all shapes?
fill(4, 40, 58);
arc(350, 250, 70, 70, 0, PI+HALF_PI+QUARTER_PI, PIE);
arc(650, 250, 70, 70, 0, PI+HALF_PI+QUARTER_PI, PIE);

//eyebrows
fill(10, 20, 20);
rotate(0.15);
rect(330, 132, 120, 7);
rotate(-0.30);
rect(540, 280, 120, 7);

//body
rotate(0.15);
fill(25, 25, 25);
rect(260, 590, 500, 500, 100, 100, 10, 10);

//shadow-body
fill(15, 15, 15);
arc(510, 590, 230, 40, 0, PI, PIE);

//shadow-mouth
ellipse(511, 455, 80, 5);

//shadow-arms
ellipse(359, 760, 12, 180);
ellipse(660, 760, 12, 180);

//spacing-help
println(mouseX,mouseY);

}

No comments yet.

Leave a Reply

Powered by WordPress. Designed by Woo Themes