header

 

More links

Adobe Connect | Adobe Conect Custom Pods | AutoHotkey | Android | Arduino | Blog | COMM140Fractals | Grammar Checkers | Knots | a Million Dots |  Processing | RedBubble | Tutorials | Weather | World Time Meeting Planner |

Home > Tutorials > Processing > Processing Examples > Scintillating Grid

Scintillating Grid

Scintillating Grid

Based on the work of: Schtauf, M., Lingelbach, B., Wrist, E.R. (1997). The scintillating grid illusion. Vision Research, 37, 1033-1038.

code formatter

processing code

01
02
03
04
05
06
07
08
09
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
// Scintillating Grid 
// Author: Rupert Russell
// October 2, 2010
// Schtauf, M., Lingelbach, B., Wrist, E.R. (1997)
// The scintillating grid illusion. Vision Research,
// 37, 1033-1038.

void setup() {
  size(283, 200);         
  background(0);          // black background
  strokeWeight(3);        // medium weight lines 
  smooth();               // antialias lines
  stroke(100, 100, 100);  // dark grey colour for lines
  noLoop();
}

void draw() {
  int step = 25;          // grid spacing
  
  //vertical lines
  for (int x = step; x < width; x = x + step){
    line(x, 0, x, height); 
  }
  
  //horizontal lines
  for (int y = step; y < height; y = y + step){
    line(0, y, width, y);
  }
  
  // Circles
  smooth();
  ellipseMode(CENTER);
  stroke(256, 256, 256);  // white circles
  for (int i = step; i < width -5; i = i + step) {
    for (int j = step; j < height -15; j = j + step) {
      strokeWeight(6); 
      point(i, j);
      strokeWeight(3); 
    }
  }
}

// Save tif when mouse is clicked
void mouseClicked(){   
  noLoop();
  save("scintillating.tif");
}
code formatter

 

 


APA citation:
Russell, R. (2016, July 04, 04:51 pm). Scintillating grid.
     Retrieved October 22, 2017, from http://www.rupert.id.au/tutorials/processing/examples/scintillating.php

Last refreshed: October 22 2017. 05:33.48 pm

rupert dot russell at acu dot edu dot au Support Wikipedia

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.


3255 visits since October 02, 2010