PImage img;
int cellsize = 5;
void setup() {
size(600, 404, P3D);
img = loadImage(“w.jpg”);
}
void draw() {
background(255);
for (int x = 0; x < width; x=x+cellsize) {
for (int y = 0; y < height; y=y+cellsize) {
int index = x + y * width;
color c = img.pixels[index];
float z = map(brightness(img.pixels[index]), 0, 255, 0, mouseX);
pushMatrix();
translate(x, y, z);
fill(c);
noStroke();
rectMode(CENTER);
rect(0, 0, cellsize, cellsize);
popMatrix();
}
}
}
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int sensorValue = analogRead(A0)/4;
Serial.write(sensorValue);
delay(1);
}
In my lab, I used the rheostat to change the distance between each block in that pixel image. I, as a human, interact with that the computers to eventually display and process the product. Basically, my product is interactive in a small scale, but if designers use this in some larger products, the interaction between people and computers will become obvious.
Absolutely, this is an engaging interaction. Human is involved to change the initial form of the image.
If I got more time to work on this lab, I might change the image which only displays in the computers to the larger outdoors project. Also, by adding more sensors to make it become changeable.
Leave a Reply
You must be logged in to post a comment.