-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathFeedback.pv
More file actions
32 lines (26 loc) · 1.15 KB
/
Copy pathFeedback.pv
File metadata and controls
32 lines (26 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Getting meta with the canvas.
PlotDevice allows you to query the current state of the canvas,
and even use its contents as an image. This allows for some trippy
feed-back effects.
"""
size(500, 500)
# By default, the canvas draws a white background, so as we overlay
# each copy it replaces everything below it. Try uncommenting the
# next line to use a transparent background instead:
# background(None)
# Draw some ovals on screen, just to get something to display.
for i in range(1000):
oval(random(WIDTH), random(HEIGHT), 20, 20, fill=(random(), random(), 0, random()))
# Now do the feedback ten times.
for i in range(10):
# Scale each copy down a bit and rotate it. This gives the familiar
# betacam-pointing-at-a-television feedback effect. You can play with
# these parameters to get other effects.
scale(0.98)
rotate(1)
# Here's the tricky bit. We call the image() command but rather than
# passing it the path to an image file, we use the contents of the
# canvas itself (using the `canvas` variable in the local namespace).
# Try blurring the image by addding: alpha=0.8
image(canvas, random(-50,49), random(-50,49))