Eric Brockmeyer – Schotter

by eric.brockmeyer @ 5:04 pm 11 January 2011

This is a processing.js file uploaded to my lab’s site. The wordpress processing.js plug-in had a problem with my class, however the code works fine when run with the processing.1.0.0.min.js file.

Press ENTER to pause.

This is the processing code for the Schotter project.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//Eric Brockmeyer
//Interactive Art and Computational Design 
//January 11, 2011
//Reproduction of "Schotter" by Georg Nees
//press ENTER to pause!
Square[][] squares = new Square[12][24];
int keyValue = 0;
void setup(){
  size(241, 481);
  frameRate(24);
  background(#000000);
  for (int i = 0; i < 12; i++){
   for (int j = 0; j < 24; j++){
    squares[i][j] = new Square(i,j);
   }    
  }
}
void draw(){
  background(#000000);
  drawSquares();
}
void drawSquares(){
  for (int i = 0; i < 12; i++){
   for (int j = 0; j < 24; j++){
    squares[i][j].move();
    squares[i][j].draw();
   }    
  }
}
void keyPressed(){
  if (key == ENTER){
   if (keyValue == 0){
    keyValue = 1;
    noLoop();
   } 
   else {
    keyValue = 0; 
    loop();
   }  
  } 
}
class Square {
  int x, y, dim;
  float rotation;
  float xRandom, yRandom;
  Square(int xTemp, int yTemp) {
    x = xTemp;
    y = yTemp;
    dim = 20;
    rotation = 0;
  }
  void move() {
    rotation = y * random(0.05);
    xRandom = x + Y * random(-0.05,0.05);
    yRandom = y + y * random(-0.05,0.05);
  }
  void draw() {
    pushMatrix(); 
    translate(xRandom*dim+(dim/2), yRandom*dim+(dim/2)); 
    rotate(rotation);
    translate(-dim/2, -dim/2);
    noFill();
    strokeWeight(1);
    stroke(#ffffff);
    rect(0, 0, dim, dim);
    popMatrix(); 
  }
}

This is the Schotter processing applet.

Press ENTER to pause.

This is my Open Frameworks Schotter example.

OF “Schotter” Interpretation from eric brockmeyer on Vimeo.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2022 Interactive Art & Computational Design / Spring 2011 | powered by WordPress with Barecity