FACES

Physical Computing

I started this project for PComp due to my strong interest in manipulating faces. My aim with the project was to change facial features, expressions, or change the entire face from one person’s to another’s using different sensors. Since halloween is right around the corner, I decided to turn a beautiful woman into a witch using a proximity sensor.

This is the first sketch I made to use for the rest of the frames. It is my first shot at animation with any medium, but I have always been an artist at heart it came quite naturally:

Next, I built a little station to trace, and alter my frames in sketch form, and for that I used a lamp and a transparent platform to illuminate the sketches from below.

Necessity is the mother of invention right?

The FRAMES:

Here’s a GIF of the animation:

Sensor:

I used an ultrasonic sensor (HC-SR04) for this project, because it’s range was 3 cm to 4 m, which is perfect for a person walking towards the sensor and keeps the screen in visibility range.

The sensor works by using one pin as an output to emit a sound wave, and the other as an input to receive it back after it has bounced off the object in front of it. So my code, which was to use the sensor through the arduino and return a value for distance, had to include the simple distance/speed formula using the speed of sound.

 

Once my sensor started working efficiently to give the distance in centimeters, I noticed that the sensor was not working efficiently after about 1 meter, and it worked best when used which a smooth object, instead of a person.

The code for serial communication and the animation is below:

FACES from Amena Hayat on Vimeo.

 

http://alpha.editor.p5js.org/amena91/sketches/B1rKrlaTb

All Shapes and Sizes Barbie

Computational Media

Barbie, and the world in general, has been known to celebrate and look up to one particular kind of beauty, which is tall, skinny and white skinned. Not only is this standard highly difficult to achieve, but the non-inclusivity of the concepts of beauty that the general public has held for generations has been making women all over the world feel less comfortable in their own skin. Women are body shamed when they don’t fit a certain mould or skin color.

Generic old iconic-ass Barbie

Doll companies, alongside the people who control famous actresses and models, and popular media from advertisements to fashion magazines promote unattainable and restrictive beauty standards and cause a lot of pain, body dysphoria, and low self esteem among women and girls. Capitalism uses low self esteem as fuel to sell women products, and sometimes it all starts with a little girls first Barbie doll. Fortunately, recently women are now taking charge of what these beauty standards may be. A movement of acceptance has started, aiming towards more body positivity and diversity.

Body Positivity + Diversity

This has not only led to the Photoshopping of fashion magazines to be revealed more often, to models speaking about eating disorders, belly rolls, and stretch marks, but also doll companies to invest in dolls that more people can relate to. Ideals are being shifted, and capitalism is tweaking itself.

These are the dolls of the All Shapes and Sizes Barbie campaign:

In this assignment, I decided to make a function that takes as arguments weight, height and ethnicity, and outputs a doll.

function allShapesBarbie(x,y,heavy,tall,ethnicity)

(x,y): Coordinates on canvas

Heavy: Weight in pounds, ranging from 90 to 200 lbs

Tall: Height in inches, ranging from 5 foot 2 inches to 6 feet

Ethnicity: 1 for White, 2 for South Asian, 3 for African American — limited to three in my code to keep it simple but more can be added.

My code:

function setup() {
createCanvas(650, 500);
}

function draw() {
allShapesBarbie(50,100,90,67,1);
allShapesBarbie(150,126,130,63,2);
allShapesBarbie(250,78,105,70,3);
allShapesBarbie(350,145,90,60,1);
allShapesBarbie(465,146,190,60,3);
allShapesBarbie(580,68,90,72,2);
}

function allShapesBarbie(x,y,heavy,tall,ethnicity){

let skinColor;
let white = color(252, 226, 199);
let black = color(140, 95, 49);
let southasian = color(229, 166, 114);

if (ethnicity == 1){
skinColor = white;
}
else if (ethnicity == 2){
skinColor = southasian;
}
else if (ethnicity == 3){
skinColor = black;
}
else {print(“Invalid Ethinicty Number, Enter 1, 2 or 3 please.”);}

//Face
let faceWidth = map(heavy,90,200,40,54);
ellipseMode(CENTER);
rectMode(CENTER);
noStroke();
fill(112, 60, 4);
arc(x+7,y-22,42,26,PI,0);
arc(x-14,y-22,24,22,PI,0);
rect(x+1,y+5,54,59);
fill(skinColor);
ellipse(x,y,faceWidth,54);//faceshape
strokeWeight(1);
stroke(0);
fill(255);
ellipse(x-10,y-5,8,10);//eyes
ellipse(x+10,y-5,8,10);
fill(0);
ellipse(x-10,y-4,6,6);
ellipse(x+10,y-4,6,6);
noStroke();
fill(168, 24, 11);
ellipse(x-3,y+10,9,9);//lips
ellipse(x+3,y+10,9,9);
fill(242, 53, 36);
arc(x,y+10,15,12,0,PI);
fill(112, 60, 4);
arc(x+7,y-28.5,30,30,0,PI);//fringe

//Dress

let shoulder = map(heavy,90,200,30,40);
let waistx1 = map(heavy,90,200,20,40);
let waisty1 = map(tall,60,72,78,98);
let waistx2 = map(heavy,90,200,40,70);
let waisty2 = map(tall,60,72,140,170);
fill(0);
beginShape();
vertex(x-(shoulder),y+34);
vertex(x-10,y+34);
vertex(x-10,y+24);
vertex(x+10,y+24);
vertex(x+10,y+34);
vertex(x+(shoulder),y+34);
vertex(x+(waistx1),y+(waisty1));
vertex(x+(waistx2),y+(waisty2));
vertex(x-(waistx2),y+(waisty2));
vertex(x-(waistx1),y+(waisty1));
vertex(x-(shoulder),y+34);
endShape(CLOSE);

//Arms //put behind dress?

noFill();
let armFat = map(heavy,90,200,13,26);
let armLength = map(tall,60,72,80,122);
strokeWeight(armFat);
stroke(skinColor);
arc(x-(waistx1),y+(waisty1),36,armLength,HALF_PI,(3/2)*PI);
arc(x+(waistx1),y+(waisty1),36,armLength,(3/2)*PI,HALF_PI);

//Thighs

fill(skinColor);
let thighx1 = map(heavy,90,200,28,31);
let thighx2 = map(heavy,90,200,10,4);
let thighy = map(tall,60,72,140,170);
let kneex1 = map(heavy,90,200,18,26);
let kneex2 = map(heavy,90,200,10,16);
let kneey = map(tall,60,72,190,250);

beginShape();
vertex(x-(thighx1),y+(thighy));
vertex(x-(kneex1),y+(kneey));
vertex(x-(kneex2),y+(kneey));
vertex(x-(thighx2),y+(thighy));
endShape(CLOSE);
beginShape();
vertex(x+(thighx1),y+(thighy));
vertex(x+(kneex1),y+(kneey));
vertex(x+(kneex2),y+(kneey));
vertex(x+(thighx2),y+(thighy));
endShape(CLOSE);

//Boots
fill(0);
noStroke();
let bootx1 = map(heavy,90,200,32,40);
let bootx2 = map(heavy,90,200,0,2);
let booty = map(tall,60,72,195,250);
let bootheelx = (bootx1 + bootx2)/2
let bootheely = map(tall,60,72,270,350);

triangle(x-(bootx1),y+(booty),x-(bootheelx),y+(bootheely)+10,x-(bootx2),y+(booty));
ellipse(x-(bootheelx),y+(bootheely),25,20);
rect(x-(bootheelx),y+(bootheely)+7.5,25,5);

triangle(x+(bootx1),y+(booty),x+(bootheelx),y+(bootheely)+10,x+(bootx2),y+(booty));
ellipse(x+(bootheelx),y+(bootheely),25,20);
rect(x+(bootheelx),y+(bootheely)+7.5,25,5);

}

The output:

Play with more dolls here:

http://alpha.editor.p5js.org/amena91/sketches/HkEdfl53-

 

Servo Motor Sunflower

Physical Computing

For physical computing this week, I wanted to play with a sensor that takes input from natural things, like light and sound. After many inspirational instructables, I found someone making a sunflower with light as a sensor, using photo-resistors (facing opposite directions) as sensors.

I decided to give it my time because it felt like a gateway into the things I want to make in the future. After getting the general idea, I drew up the circuit and coded the micro-controller to take not just light but the direction of light as its input.

Schematic

Code:

I played with delays, and decided I wanted a slow, more pronounced movement toward the light.

Watch the Sunflower in action:

Servo Motor Sunflower from Amena Hayat on Vimeo.

 

“what kind of sunflower are you? the sun is that way”

White Noise on TV Simulation

Computational Media

Group Members

Amena Hayat

Sofia Luisa

The inspiration for this week’s ICM assignment came a bit late. Me and Sofia were trying different things at first, from pointillism sketches to Eadward Muybridge’s horse. But after not being able to conceptualise an algorithm for either of those, we tried our hand at the white noise TV screen:

You can almost hear it

To build this with for loops was a challenge, because we had to incorporate two different designs in them and nest them together with the same variable.

We got the white noise working, with the stripes on a click, in a separate file:

The next thing was to make it fun and interactive. For that we fit the code onto the dimensions of a TV we created, and made the stripes appear at the click of the button on this TV. If it looks easy, well it was not.

Here’s the final thing, CLICK:

Our Code:

// coordinates
let x = 0
let y = 0

//height and width
let wh = 5

//button coordinates
let bx = 342;
let by = 190;
let bsize = 40;

function setup() {
createCanvas(400, 400);
}

function draw() {
background(237, 170, 37);
print(“X=”, mouseX, ” Y=”, mouseY);

//TV box:
strokeWeight(7);
stroke(137, 136, 134);
line(196, 130, 204, 10);
line(200, 140, 358, 16);
strokeWeight(3);
stroke(186, 184, 180);
line(191, 130, 199, 10);
line(195, 140, 353, 16);
noStroke();
fill(186, 184, 180);
ellipse(204, 10, 15, 15);
ellipse(360, 14, 15, 15);
fill(137, 136, 134);
ellipse(207, 10, 15, 15);
ellipse(362.5, 14, 15, 15);
strokeWeight(10);
stroke(63, 36, 10);
fill(114, 65, 18);
rect(5, 130, width – 10, height – 145, 10);
strokeWeight(4);
fill(0);
rect(18, 135, 280, 245, 10);
strokeWeight(6);
stroke(168, 164, 159);
fill(112, 109, 106);

ellipse(bx, by, bsize, bsize); //button

strokeWeight(6);
stroke(0);
line(307, 242, 378, 242);
line(307, 252, 378, 252);
line(307, 262, 378, 262);
line(307, 272, 378, 272);
line(307, 282, 378, 282);
line(307, 292, 378, 292);
line(307, 302, 378, 302);
line(307, 312, 378, 312);
line(307, 322, 378, 322);
line(307, 332, 378, 332);
//noise:
noStroke();
//how much x coordinate grows
push();
for (x = 25; x <= (293); x += 10) {  //TVscreen limits
for (y = 141; y <= (375); y += 10) {
pop();

if (mouseIsPressed == true){  //&& if (dist(mouseX,mouseY,bx,by)<bsize/2)
fill(random(0, 255), random(0, 255), random(0, 255));
rect(x – 3, y * 6, (width / 6) – 55, -height * 6);
fill(237, 170, 37);
rect(22,0,275,125);
rect(21,390,275,100);
strokeWeight(7);
stroke(137, 136, 134);
line(196, 130, 204, 10);
line(212, 130, 358, 16);
strokeWeight(3);
stroke(186, 184, 180);
line(191, 130, 199, 10);
line(198, 135, 353, 16);
noStroke();
fill(186, 184, 180);
ellipse(204, 10, 15, 15);
ellipse(360, 14, 15, 15);
fill(137, 136, 134);
ellipse(207, 10, 15, 15);
ellipse(362.5, 14, 15, 15);
fill(63, 36, 10);
rect(21,125,275,13);
rect(21,379,275,11);

} else {
fill(random(0, 255), 0, 0);
rect(x, y, wh, wh);
fill(0, 0, random(0, 255));
rect(x + 2, y + 2, wh, wh);
fill(100, random(0, 255), 0);
rect(x – 3, y – 3, wh, wh);
}
}
}
}

 

 

Bye now, sweet dreams.