-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0008_keep_still.py
More file actions
54 lines (44 loc) · 1.29 KB
/
0008_keep_still.py
File metadata and controls
54 lines (44 loc) · 1.29 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
def setup():
size(1200, 1200)
# white background for lines
noStroke()
fill(255)
quad(0, 0, 400 - 10, 0, (400 - 10) * 2.5, height, 0, height)
# white underlay for twisted shape =)
noFill()
strokeWeight(7)
stroke(255)
quad(0, 0, 0, width / 5, height, 0, height, width * 0.75)
strokeWeight(1)
stroke(0)
for i in range(-10, width / 3, 5):
line(i, 0, i * 5, height)
# black quad over lines
noStroke()
fill(0)
quad(400 - 10, 0, width, 0, width, height, (400 - 10) * 2.5, height)
# white twisted
fill(255)
quad(0, 0, 0, width / 5, height, 0, height, width * 0.74)
def polygon(x, y, radius, npoints):
angle = TWO_PI / npoints
with beginClosedShape():
a = 0
while a < TWO_PI:
sx = x + cos(a) * radius
sy = y + sin(a) * radius
vertex(sx, sy)
a += angle
def draw():
# black circle
stroke(255)
strokeWeight(3)
fill(0)
ellipseMode(CENTER)
ellipse(width * 0.7, height * 0.145, 300, 300)
strokeWeight(2.5)
with pushMatrix():
translate(width * 0.7, height * 0.145)
rotate(frameCount / 400.0)
polygon(0, 0, 80, 3)
# saveFrame('/frames/####.png')