Guest User

Untitled

a guest
Nov 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. # Python flavored example
  2. # from "Generative Art" p xxiii
  3. # doug goodwin
  4.  
  5. xstart = random(10)
  6. ynoise = random(10)
  7.  
  8. def setup():
  9. size(1000, 1000, P3D)
  10. background(150)
  11. stroke(0, 50)
  12. fill(255, 200)
  13. translate(width/2, height/2, 0)
  14. frameRate(1)
  15.  
  16. def drawPoint(x, y, noiseFactor):
  17. pushMatrix()
  18. translate( (x * noiseFactor * 4), (y * noiseFactor * 4), -y)
  19. edgeSize = noiseFactor * 26
  20. ellipse(0, 0, edgeSize, edgeSize)
  21. popMatrix()
  22.  
  23.  
  24. def draw():
  25. global ynoise
  26. background(150)
  27. translate(width/2, height/2, 0)
  28. for y in range( -(height/8), (height/8), 3 ):
  29. ynoise = ynoise + 0.02
  30. xnoise = xstart
  31. for x in range( -(width/8), (width/8), 3):
  32. xnoise += 0.02
  33. drawPoint(x, y, noise(xnoise, ynoise))
Add Comment
Please, Sign In to add comment