globals [mode] turtles-own [x-v y-v x-damp y-damp i] to startup ca setup end to setup cd if not any? turtles [foreach n-values 51 [?] [crt 1 [ht set x-damp 0.9 + 0.0015 * ? set y-damp 0.975 - 0.0015 * ? set color (list 0 255 (? * 5) 5) set i 5 pd]]] end to go if mouse-down? [setup] every 0.005 [ask turtles [let new-color-value item 0 color + i ifelse new-color-value < 256 and new-color-value > -1 [set color replace-item 0 color new-color-value] [set i (- i)] ifelse mode = "star" [set x-v x-damp * (x-v + (xcor - mouse-xcor) / 100) set y-v y-damp * (y-v + (ycor - mouse-ycor) / 100)] [set x-v 0.9873 * x-v + x-damp * (xcor - mouse-xcor) / 100 set y-v 0.9873 * y-v + y-damp * (ycor - mouse-ycor) / 100] let new-xcor (xcor - x-v) let new-ycor (ycor - y-v) ifelse is-patch? patch new-xcor new-ycor [pd setxy new-xcor new-ycor] [pu]]] tick end @#$#@#$#@ GRAPHICS-WINDOW 11 10 441 461 10 10 20.0 1 10 1 1 1 0 0 0 1 -10 10 -10 10 1 1 0 ticks BUTTON 440 10 506 43 NIL go T 1 T OBSERVER NIL A NIL NIL BUTTON 440 42 512 75 change ifelse mode = \"star\"\n[set mode \"rectangle\"]\n[set mode \"star\"] NIL 1 T OBSERVER NIL S NIL NIL @#$#@#$#@ WHAT IS IT? ----------- Ghostly lines HOW IT WORKS ------------ Turtles with pen down follow the mouse. They all have different x and y velocity reducing multipliers HOW TO USE IT ------------- Push go to start the model. Move the mouse around. Click the view at any time to erase the drawing. Push change to change the mouse following algorithm. THINGS TO NOTICE ------------- Notice that the path of the turtles has perpendicular lines in relation to the direction of the path in it at certain intervals. What does this tell about the drawing algorithm of turtles with pen down? EXTENDING THE MODEL ------------------- 1)Change the code to produce some other mouse following and coloring algorithms 2)Use patches as a drawing layer and describe various color blending algorithms and line drawing algorithms CREDITS AND REFERENCES ---------------------- I saw something like this first here: http://lab.andre-michelle.com/color-traces and tried to duplicate it in netlogo @#$#@#$#@ default false 0 @#$#@#$#@ NetLogo 4.1.2 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 0 0.0 1.0 0.2 0 0.0 1.0 link direction false 0 @#$#@#$#@ 0 @#$#@#$#@