Optical Illusions

Optical Illusions preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

art 

Tagged by Reuven M. Lerner over 11 years ago

Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 1341 times • Downloaded 70 times • Run 0 times
Download the 'Optical Illusions' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model presents seven optical illusions.

HOW IT WORKS

The optical illusions are constructed using a combination of NetLogo turtles and patches.

Illusion #1

White circles on a gray background produce an illusion of the circles changing colors between black and white, depending on where you focus your eyes.

Illusion #2

Diagonals moving away from the center create an illusion of depth, which makes the parallel horizontal lines seem to bend in the center.

Illusion #3

The perpendicular lines that do not match row to row create an illusion of the lines between them being not parallel.

Illusion #4

Relative sizes of other circles skew the perception of the middle circles, creating an illusion of difference in size.

Illusion #5

Circles of diamonds seem to rotate as you focus your eyes on their center.

Illusion #6

Intensely saturated colors create an illusion of rippling waves of motion.

Illusion #7

Four simple concentric circles look like interlocking spirals.

HOW TO USE IT

Press a button to choose an illusion, and it will be presented in the NetLogo view.

Some explanatory text will appear in the monitor below the view.

EXTENDING THE MODEL

Add more illusions.

NETLOGO FEATURES

Many of the illusions in the model, such as illusions 2, 4, 5 and 7, involve turtles positioned in a circle around a middle point. This shows how to use create-ordered-turtles, forward and heading to position objects in a pattern.

RELATED MODELS

Other models that were created "for fun" include Frogger, Lunar Lander and other games included in the Games section of the Models Library.

CREDITS AND REFERENCES

Illusion #6 is based on the cover of the album "Merriweather Post Pavilion" by Animal Collective, which in turn is based on an illusion by Akiyoshi Kitaoka.

HOW TO CITE

If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

COPYRIGHT AND LICENSE

Copyright 2005 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [caption]

;; runs automatically when model is opened

to startup
  set caption ""  ;; otherwise it would start out as 0
end 

to illusion-1
  clear-all
  set caption "What color are the circles?"
  set-default-shape turtles "circle"
  ;; make the gray lines
  ask patches with [pxcor mod 5 = 0 or
                    pycor mod 5 = 0]
    [ set pcolor gray ]
  ;; make the circles
  ask patches with [pxcor mod 5 = 0 and
                    pycor mod 5 = 0]
    [ sprout 1
        [ set color white
          set size 1.7 ] ]
end 

to illusion-2
  clear-all
  set caption "Are the thick lines parallel?"
  ask patches
    [ set pcolor white ]
  ;; make 2 parallel lines
  ask patches with [abs pycor = 4]
    [ set pcolor black ]
  ;; make diagonal lines that start at the center
  ;; and go to different parts of the world
  crt 60
    [ set heading who * 6
      set color black
      set shape "line"
      set size 100 ]
  ;; make a circle in the center
  crt 1
    [ set color black
      set shape "circle"
      set size 5 ]
end 

to illusion-3
  clear-all
  set caption "Are the lines parallel?"
  set-default-shape turtles "square"
  ask patches
    [ set pcolor gray ]
  ;; every fourth patch creates a square, either black or white
  ask patches with [pxcor mod 4 = 0 and
                    pycor mod 4 = 0]
    [ sprout 1
        [ set heading 0
          set size 4.8
          ifelse pxcor mod 8 = 0
            [ set color white ]
            [ set color black ] ] ]
  ;; move every other row over 1 to the right
  ask turtles with [pycor mod 16 = 4]
    [ set xcor xcor + 1 ]
  ;; move every other row over 1 to the left
  ask turtles with [pycor mod 16 = 12 ]
    [ set xcor xcor - 1 ]
end 

to illusion-4
  clear-all
  set caption "Which inner circle is bigger?"
  set-default-shape turtles "circle"

  ;; make right figure
  let counter 0
  ask patch -12 0
    [ ;; middle circle
      sprout 1
        [ set color white
          set size 5
          ;; 6 smaller circles around the middle circle
          hatch 6
            [ set size 2.5
              set heading 60 * counter
              fd 4
              set counter counter + 1 ] ] ]
  ;; make left figure
  set counter 0
  ask patch 6 0
    [ ;; middle circle
      sprout 1
        [ set color white
          set size 5
          ;; 6 larger circles around the middle circle
          hatch 6
            [ set size 8
              set heading 60 * counter
              fd 8
              set counter counter + 1 ] ] ]
end 

to illusion-5
  clear-all
  set caption "Stare at the dot, then lean forward and back."
  ask patches
    [ set pcolor gray ]
  ;; make the inside circle of diamonds
  ;; use ordered turtles so the circle is evenly spaced
  create-ordered-turtles 32
    [ set size 2
      set shape "diamond1"
      fd 12 ]
  ;; make the outside circle of diamonds
  ;; use ordered turtles so the circle is evenly spaced
  create-ordered-turtles 40
    [ set size 2
      set shape "diamond2"
      fd 15 ]
  ;; make the dot in the middle
  crt 1
    [ set shape "circle"
      set color black ]
end 

to illusion-6
  clear-all
  set caption "Feeling queasy?"
  ask patches [
    ;; use RGB colors since ordinary NetLogo colors aren't neon enough
    set pcolor one-of [[30 58 190] [133 10 166]]
    ;; place turtles only on patches where both coordinates are even
    if pxcor mod 2 = 0 and pycor mod 2 = 0 [
      sprout 1 [
        set color [99 187 64]
        set shape "lozenge"
        __set-line-thickness 0.15
        set size 2
        ;; make repeating "wave" pattern of headings
        set heading ((pxcor + pycor) / 3) mod 6 * 30
      ]
    ]
  ]
end 

to illusion-7
  clear-all
  set caption "Spirals or circles?"
  ask patches [ set pcolor gray ]
  set-default-shape turtles "square 3"
  cro 16 [ fd  4 rt 15 ]
  cro 32 [ fd  8 lt 15 ]
  cro 46 [ fd 12 rt 15 ]
  cro 60 [ fd 16 lt 15 ]
  ask turtles [
    set size 1.7
    ifelse who mod 2 = 0
    [ set color black ]
    [ set color white ]
  ]
end 


; Copyright 2005 Uri Wilensky.
; See Info tab for full copyright and license.

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 11 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky about 12 years ago Updated version tag Download this version
Uri Wilensky about 12 years ago Updated to version from NetLogo 5.0.3 distribution Download this version
Uri Wilensky almost 13 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Model from NetLogo distribution Download this version
Uri Wilensky over 14 years ago Optical Illusions Download this version

Attached files

File Type Description Last updated
Optical Illusions.png preview Preview for 'Optical Illusions' over 11 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.