diff --git a/README.md b/README.md index 14fad886..7444ef36 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,16 @@ If you enjoy this, make a small donation [here](https://www.paypal.com/cgi-bin/w ---- +![036](sketch_180205b/sketch_180205b.png) + +036: [sketch_180205b](https://github.com/villares/sketch-a-day/tree/master/sketch_180205b) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)] +Added some mouse disturbance + +---- + ![035](sketch_180204b/sketch_180204b.gif) -034: [sketch_180204b](https://github.com/villares/sketch-a-day/tree/master/sketch_180204b) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)] +035: [sketch_180204b](https://github.com/villares/sketch-a-day/tree/master/sketch_180204b) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)] Preparing for "Carnahacking" ---- diff --git a/sketch_180205b/sketch.properties b/sketch_180205b/sketch.properties new file mode 100644 index 00000000..2456b0ab --- /dev/null +++ b/sketch_180205b/sketch.properties @@ -0,0 +1,2 @@ +mode=Python +mode.id=jycessing.mode.PythonMode diff --git a/sketch_180205b/sketch_180205b.png b/sketch_180205b/sketch_180205b.png new file mode 100644 index 00000000..1c23d9d4 Binary files /dev/null and b/sketch_180205b/sketch_180205b.png differ diff --git a/sketch_180205b/sketch_180205b.pyde b/sketch_180205b/sketch_180205b.pyde new file mode 100644 index 00000000..50a6caab --- /dev/null +++ b/sketch_180205b/sketch_180205b.pyde @@ -0,0 +1,46 @@ +from __future__ import division, unicode_literals + +CONFETI = [] +SIZE = 15 +TEXTO = """CARNAHACKING VEM AÍ""" + +def settings(): + #global fundo + #fundo = loadImage("p.jpg") + #size(fundo.width, fundo.height) + size(500, 500) + +def setup(): + noStroke() + for _ in range(1200): + CONFETI.append(([random(width), # X + random(height+20)], # Y + random(TWO_PI), # screen plane rotation + random(TWO_PI), # "Z" rotation + color(random(256), random(256), random(256)) # color + )) + +def draw(): + #background(fundo) + background(0) + + for pos, rot1, rot2, color_ in CONFETI: + #print (pos, r1, r2, c) + with pushMatrix(): + x, y = pos + translate(x, y) + rotate(rot1 + float(frameCount / 7)) + s = sin(rot2 + float(frameCount / 11)) + fill(color_) + ellipse(0, 0, SIZE, SIZE * s) + pos[1] += 1 + random(0, 2) * s # update y (pos[1]) + if y > height + 20: + pos[1] = -20 + if dist(x, y, mouseX, mouseY) < 100: + pos[1] += random(-5, 0) + pos[0] += random(-5, 5) + + + if frameCount<300 and not frameCount % 3: saveFrame("###.tga") + + \ No newline at end of file