// Author Rupert Russell
// Date September 4, 2010
// Purpose to draw a
scintillating grid illusion
// Writen in Processing see http://processing.org/
// Schtauf, M., Lingelbach, B., Wrist, E.R. (1997)
// The scintillating grid illusion. Vision Research,
// 37, 1033-1038.
void setup() {
size(1024, 760);
background(0); // black background
strokeWeight(3); // medium weight lines
smooth(); // antialias lines
}
float x = 0;
float y = 0;
float xx = 0;
float yy = 0;
int step = 19; // grid spacing
void draw() {
//vertical lines
stroke(100, 100, 100); // dark grey colour
x = x + step;
line(x, 0, x, height);
//horizontal lines
stroke(100, 100, 100); // dark grey colour
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(4);
point(i, j);
strokeWeight(3);
}
}
}
// Save tif when mouse is clicked
void mouseClicked(){
noLoop();
save("scintillating1024.tif");
}
APA citation:
Russell, R. (2016, July 04, 03:21 pm). Scintillating grid illusion.
Retrieved November 24, 2024, from
http://www.rupert.id.au/processing/scintillating_grid.php
Last refreshed: November 24 2024. 06:32.18 pm
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.