Skip to content

Instantly share code, notes, and snippets.

@albertochiwas
Last active October 13, 2016 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertochiwas/b5b5dafd618d585dd2cab1acaacda748 to your computer and use it in GitHub Desktop.
Save albertochiwas/b5b5dafd618d585dd2cab1acaacda748 to your computer and use it in GitHub Desktop.
Processing + Python
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