aUCBLogo Demos and Tests / moireepattern
to moireepattern
singleshot=Name? "framenr
N=1000 ;size and correspondingly the number of lines
setUpdateGraph false
PenUp
hideTurtle
perspective
eye=Array (List 0 0 N)
setEye eye {0 0 0}{0 1 0}
running=true
ifelse singleshot
[ angle=framenr
][ angle=0
]
while [running]
[ clearScreen
disableDepthTest
moiree N angle angle/10
angle=angle+0.1
updateGraph
if singleshot [break]
if Key? [running=false]
]
end
to moiree N ang ang2
bars N N/exp 1
Home
right ang
up 90
forward 100
down 90+10+ang2
bars N N/exp 1
end
to bars :size :num
setPenSize [0 0]
left 90+45
forward :size/sqrt 2
right 90+45
repeat Int :num
[ PenDown
forward :size
PenUp
back :size
right 90
forward :size/(:num-1)
left 90
]
end