I manage to develop more and more to get more exciting result that I would love.
Comment : tweak some values in the previous code, the shape is slightly different. The outcome is still good, but nothing different.
CODE :
---------------------------------------------------------------------------------------------------------------
import math
def setup():
size(1200,1200)
background(255)
stroke(0)
smooth()
def Xfunction(z):
return 300.*math.cos(1.6180339887*z)
def Yfunction(z):
return 300.*math.sin(6.28*z)
def draw():
background(255)
for i in range(1, 1200.):
z = i / 200.
angle = mouseX*i*0.01
trans = mouseY+i%5000
lx = Xfunction(0.) + trans
ly = Yfunction(0.) + trans
x = Xfunction(z) + angle
y = Yfunction(z) + angle
line(lx, ly, x, y)
line(ly, lx, y, x)
lx = x
ly = y
---------------------------------------------------------------------------------------------------------------
Tweak the value again, now is another different result but the style is kept
Comment : Preferred style, blossoming-flower-liked look.
CODE :
---------------------------------------------------------------------------------------------------------------
import math
def setup():
size(1200,1200)
background(255)
stroke(0)
smooth()
def Xfunction(z):
return 300.*math.cos(1.6180339887*z)
def Yfunction(z):
return 300.*math.cos(6.28*z)
def draw():
background(255)
for i in range(1, 1200.):
z = i / 200.
angle = mouseX*i*0.01
trans = mouseY+i%5000
lx = Xfunction(0.) + trans
ly = Yfunction(0.) + trans
x = Xfunction(z) + angle
y = Yfunction(z) + angle
line(lx, ly, x, y)
line(ly, lx, y, x)
---------------------------------------------------------------------------------------------------------------
Still playing around by mouse, but I managed to create another new code, would be change the result significantly.
Comment : I was "Wow, amazing". But later I felt somehow too complicated and confused. But yes, another good trial. Also I tried to change the colour style (grey & white) for more experimenting.
CODE :
---------------------------------------------------------------------------------------------------------------
import math
def setup():
size(600,600)
background(150)
stroke(255)
smooth()
def draw():
background(150)
for i in range(500):
angle = mouseY * i
x = i * 1.61803399 * math.sin(angle)
y = i * 1.61803399 * math.cos(angle)
width = 1
line(300+x, 300+y, width+i, width+i)
---------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment