diff --git a/2019/sketch_190504a/sketch_190504a.py b/2019/sketch_190504a/sketch_190504a.py index 3915b548..c9b4030d 100644 --- a/2019/sketch_190504a/sketch_190504a.py +++ b/2019/sketch_190504a/sketch_190504a.py @@ -1,4 +1,8 @@ -from pytop5js import * +# Alexandre B A Villares +# run this, install and run pyp5js +# instructions at https://pypi.org/project/pyp5js/ + +from pyp5js import * def setup(): createCanvas(400, 400) @@ -21,6 +25,5 @@ def draw(): sy2 = y2 + sin(a2) * r * cos(frameCount/30.) line(sx1, sy1, sx2, sy2) - # This is required by pyp5js to work start_p5(setup, draw) diff --git a/2019/sketch_190505a/sketch_190505a.pyde b/2019/sketch_190505a/sketch_190505a.pyde new file mode 100644 index 00000000..798615c2 --- /dev/null +++ b/2019/sketch_190505a/sketch_190505a.pyde @@ -0,0 +1,47 @@ +# Sibeli Animation + +w = h = d = 1 + +# Cubo +max_w = 200 +max_h = 200 +max_d = 200 + +# plano B - Paralelepípedo +# max_w = 100 +# max_h = 150 +# max_d = 50 + +pausa = 100 + +def setup(): + size(500, 500, P3D) + noFill() + strokeWeight(5) + +def draw(): + global w, h, d # para modificar variáveis globais em Python + background(200) # fundo e limpa frame + translate(250, 250) # muda origem das coordenadas para o centro da tela + # giro quando o cubo cresce + rotateX((d - 1) / 100.) + rotateZ((d - 1) / 100.) + # desenha a "caixa" (ponto, linha, retêngulo e caixa...) + box(h, w, d) + + if w < max_w: + if frameCount > pausa: + w += 1 + elif h < max_h: + if frameCount > 2 * pausa + max_w: + h += 1 + elif d < max_d: + if frameCount > 3 * pausa + max_w + max_h: + d += 1 + else: + noLoop() + + # para salvar frames + #saveFrame(str(w) + "_" + str(h) + "_" str(d) + "_frame#####.png") + +