Alexandre B A Villares 2018-03-08 23:20:02 -03:00
rodzic 6b331a4ac8
commit c468288d5f
2 zmienionych plików z 39 dodań i 0 usunięć

37
s067/s067.pyde 100644
Wyświetl plik

@ -0,0 +1,37 @@
"""
sketch 67 180308 - Alexandre B A Villares
https://abav.lugaralgum.com/sketch-a-day
"""
def setup():
size(400, 400)
colorMode(HSB)
strokeWeight(5)
noFill()
def draw():
background(0)
N = map(mouseX, 0, width, QUARTER_PI/2, HALF_PI)
D = map(mouseY, 0, height, 1, 5)
poly_shape(width/2, height/2, N, D)
def poly_shape(x, y, angle, D):
stroke((frameCount/10 * D) % 256, 255, 255, 100)
with pushMatrix():
translate(x, y)
radius = 5 + D * 20
ps = createShape()
ps.beginShape()
a = 0
while a < TWO_PI:
sx = cos(a) * radius
sy = sin(a) * radius
ps.vertex(sx, sy)
a += angle
ps.endShape(CLOSE)
shape(ps, 0, 0);
if D > 1:
for i in range(ps.getVertexCount()):
pv = ps.getVertex(i) # PVector
poly_shape(pv.x, pv.y, angle, D-1)

Wyświetl plik

@ -0,0 +1,2 @@
mode=Python
mode.id=jycessing.mode.PythonMode