NeuroAndArt_Final

NeuroAndArt_Final project

Optical Illusion

For the final, I decided to do an optical illusion with code. To see how our optical center works and test to which degree we can deceive our eyes and minds.

As wikipedia puts, an optical illusion (also called a visual illusion) is an illusion caused by the visual system and characterized by a visual percept that (loosely said) appears to differ from reality.

There are some famous optical illusions like

0

0

Use them as inspiration, I made another one:

0

These are just some circles on top of each other. But it looks like a cone, especially when it’s moving. Our minds conceive depth/space/volume out of 2d graphs according to some features of geometric objects.

This is made with Processing based on Java.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
void setup(){
size(600, 600);
noStroke();
}
void circle(int i){
int j = 0;
if(i == 25) return;
fill(255, 0, 0);
j = (i > 1) ? -10 : 10;
translate(j, 0);
if(i%2==0){fill(0,0, j);}
ellipse(0, 0, 400 - (i*20), 400 - (i*20));
circle(i+1);
}
void draw(){
background(0);
translate(width/2, height/2);
rotate(frameCount/50.0f);
circle(0);
}