#temporal interpolation between polygons of decreasing sides
g.antialias(1/2)
import math
g.paper(100)
def polygon(z, y, radius, sides):
for a in range (1,24):
for b in range (2,12):
theta = a*(math.pi*2/sides)
theta1 = (a-1)*(math.pi*2/sides)
g.line(int(z+radius*math.cos(theta1)), int(y+radius*math.sin(theta1)), int(z+radius*math.cos(theta)), int(y+radius*math.sin(theta)))
|
while 1:
m1 = g.getMouse(1)
g.pen(m1)
polygon(45, 55, 40, 10)
g.pen(m1*2)
polygon(46, 56, 35, 9)
g.pen(m1*4)
polygon(47, 57, 30, 8)
g.pen(m1*6)
|
polygon(48, 58, 25, 7)
g.pen(m1*8)
polygon(49, 59, 20, 6)
g.pen(m1*10)
polygon(50, 60, 15, 5)
g.pen(m1*12)
polygon(51, 61, 10, 4)
g.pen(m1*14)
polygon(52, 62, 5, 3)
|