Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITDH = 1000
- HEIGHT = 1000
- MAX = 12 * PI
- def frange (ini, fin, step):
- l = []
- while (ini < fin):
- l.append(ini)
- ini += step
- return l
- def drawRose (k, c, d, a0, af, step):
- noFill()
- a = a0
- beginShape()
- while (a <= af):
- x = map((cos(k * a + d) + c)* cos(a + d), -c - 1, c + 1, 0, WITDH)
- y = map((cos(k * a + d) + c)* sin(a + d), -c - 1, c + 1, 0, HEIGHT)
- vertex(x, y)
- a += step
- endShape()
- def setup():
- size(1000, 1000)
- background(0)
- blendMode(ADD)
- #EXAMPLE
- for i in frange(1.2, 3, 0.1):
- stroke(255, map(i, 1.2, 3, 0, 255), 50)
- drawRose(5.0 / 3, i, i, 0, MAX, MAX / 1000)
- noLoop()
- def draw():
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement