Virtual Blinds

Experiments in processing, recreating a physical sensation in a digital format

PImage img; int d = 80; int middle = width/2; int t=15; int t2=25;

void setup() { size(displayWidth, 40, P2D); surface.setResizable(true); // img = loadImage("Desktop.jpg"); //img.resize(displayWidth, displayHeight); }

void mouseWheel(MouseEvent event) { if (mouseX>10 && mouseX<30 data-preserve-html-node="true" && mousePressed) { int e = event.getCount();

hRect += e *5 ;
println(hRect);
println(e);

if (e > 0) {
  t++; 
  t2++;
}
if (e < 0) {
  t--; 
  t2--;
} 
if (t > 30) {
  t=10;
}
if (t2 > 30) {
  t2=10;
}
if (t < 10) {
  t=30;
}
if (t2 < 10) {
  t2=30;
}

} } float hRect = 1 ;

void draw() {

background(154, 203, 255); fill(249, 215, 28); circle(displayWidth0.8, displayHeight.25, displayWidth/4); fill(255); if (1==frameCount) surface.setLocation(-10, 0); if (hRect > d) hRect = d; if (hRect < -d) hRect = -d;

for (int i = d; i <= data-preserve-html-node="true" width; i += d) {

//image(img, 0, 0);

rect(0, i - d, width, hRect);

rect(0, height-30, width, 30); rect(10, 0, 20, height); } line(t, 0, t, height); line(t2, 0, t2, height); }

Previous
Previous

Interactive Seurat