Last active
October 13, 2016 07:04
-
-
Save albertochiwas/b5b5dafd618d585dd2cab1acaacda748 to your computer and use it in GitHub Desktop.
Processing + Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
poly = [(10,40),(40,40),(50,10),(60,40),(90,40), | |
(65,60),(75,90),(50,70),(25,90),(35,60),(10,40)] | |
tam = len(poly) | |
w, h, g, inc, s = 400, 400, 0, 1, None | |
def setup(): | |
global w, h, tam, poly, s | |
size(w,h) | |
frameRate(4) | |
strokeWeight(4); | |
s = createShape() | |
s.beginShape() | |
for p in poly: s.vertex(*p) | |
s.endShape() | |
def draw(): | |
global g, inc, s | |
background(0,50,200) | |
translate(width/2, height/2) | |
g = (g+inc) % 360 | |
rotate(radians(g)) | |
translate(-width/2, -height/2) | |
with pushMatrix(): | |
scale(4) | |
shape(s) | |
def mouseClicked(): | |
global inc | |
inc = - inc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment