Wednesday, 28 March 2012

MORE DEVELOPMENTS!

I now try to differentiate the colours through mouse's coordinate.... developed from the colours list I had tried before... also function IF is used


Comment : White for background, also I combined the alpha into colours so made the opacity lower for more transparency effect. I love this outcome, so elegant, flexible and kind of chaotic.

CODE :
--------------------------------------------------------------------------------------------------------------------------------------
import math

def setup():
    size(800,800)
    stroke(255)
    smooth()
   
colors = range(5)
colors[0] = color(10,58,74,150)
colors[1] = color(25,106,115,150)
colors[2] = color(50,166,166,150)
colors[3] = color(161, 191, 51,150)
colors[4] = color(200,217,74,150)

def rcfunction():
    if (mouseY>100) :
        rf = colors[0]
    if (mouseY>200):
        rf = colors[1]
    if (mouseY>300):
        rf = colors[2]
    if (mouseY>400):
        rf = colors[3]
    if (mouseY<101):
        rf = colors[int(random(0,1))]
    fill(rf)
                   
       
def draw():
    background(250)
    for i in range(1,600,2):
        angle = mouseX * i * 0.001
        x = i * 3.14 * math.sin(angle)
        y = i * 3.14 * math.cos(angle)
        width = math.pow(i, -2)
        rcfunction()
        ellipse(mouseX+x, mouseY+y, width+i*0.8, width+i*0.8)
---------------------------------------------------------------------------------------------------------------


Comment : Change a little bit, move more chaotically, randomly move forward then backward. This is the way I preferred

CODE :
---------------------------------------------------------------------------------------------------------------
import math

def setup():
    size(800,800)
    stroke(255)
    smooth()
   
colors = range(5)
colors[0] = color(10,58,74,150)
colors[1] = color(25,106,115,150)
colors[2] = color(50,166,166,150)
colors[3] = color(161, 191, 51,150)
colors[4] = color(200, 217, 74, 150)

def rcfunction():
    if (mouseY<=200):
        rc = colors[0]
    if (mouseY>200) and (mouseY<=400):
        rc = colors[2]
    if (mouseY>400) and (mouseY<=600):
        rc = colors[3]
    if (mouseY>600) and (mouseY<=800):
        rc = colors[4]
    fill(rc)
                   
       
def draw():
    background(240)
    for i in range(1,600,2):
        angle = mouseX * i * 0.001
        x = i * 3.14 * math.sin(angle)
        y = i * 3.14 * math.cos(angle)
        width = math.pow(i, -2)
        rcfunction()
        ellipse(mouseX+x, mouseY+y, width+i*0.8, width+i*0.8)
---------------------------------------------------------------------------------------------------------------


Comment : Tried draw more shapes like squares, nothing really change. The outcome is just for fun but still significant to get refreshed

CODE :
---------------------------------------------------------------------------------------------------------------
import math

def setup():
    size(800,800)
    stroke(255)
    smooth()
   
colors = range(5)
colors[0] = color(10,58,74,150)
colors[1] = color(25,106,115,150)
colors[2] = color(50,166,166,150)
colors[3] = color(161, 191, 51,150)
colors[4] = color(200, 217, 74, 150)

def rcfunction():
    if (mouseY<=200):
        rc = colors[0]
    if (mouseY>200) and (mouseY<=400):
        rc = colors[2]
    if (mouseY>400) and (mouseY<=600):
        rc = colors[3]
    if (mouseY>600) and (mouseY<=800):
        rc = colors[4]
    fill(rc)
                   
       
def draw():
    background(240)
    for i in range(1,600,2):
        angle = mouseX * i * 0.001
        x = i * 3.14 * math.sin(angle)
        y = i * 3.14 * math.cos(angle)
        width = math.pow(i, -2)
        rcfunction()
        ellipse(mouseX+x, mouseY+y, width+i*0.8, width+i*0.8)
        rect(mouseX+y, mouseY+x, width+i*0.2, width+i*0.2)
        rect(mouseX+y, mouseY+x, width+i*0.6-100, width+i*0.6-100)
---------------------------------------------------------------------------------------------------------------
Go back and test with PI or 2PI, also applied power into math function.... going to get new ideas!

 Comment : Spiral ladder thingy! Amazing, the movement is exactly wave-liked. I like it so much, but it kind of impossible to fill all the sketch, somehow I still felt so blank. Anyway, still a good trial though.

CODE :
---------------------------------------------------------------------------------------------------------------
import math

def setup():
    size(800,800)
    stroke(255)
    smooth()
   
colors = range(5)
colors[0] = color(10,58,74,150)
colors[1] = color(25,106,115,150)
colors[2] = color(50,166,166,150)
colors[3] = color(161, 191, 51,150)
colors[4] = color(200, 217, 74, 150)

def rcfunction():
    if (mouseY<=200):
        rc = colors[0]
    if (mouseY>200) and (mouseY<=400):
        rc = colors[2]
    if (mouseY>400) and (mouseY<=600):
        rc = colors[3]
    if (mouseY>600) and (mouseY<=800):
        rc = colors[4]
    fill(rc)

       
def draw():
    background(240)
    rcfunction()
    for ii in range (1,800):
        trans = mouseY + ii
        xx = ii * 6.28 * math.pow(math.sin(trans),2)
        yy = ii * 6.28 * math.pow(math.cos(trans),2)
        width = math.pow(ii, -25)
        ellipse(mouseX+xx, mouseY+yy, width+ii*0.8, width+ii*0.8)
---------------------------------------------------------------------------------------------------------------
The rest is so blank... What can I do?! Tried to keep going...
Here another try:
 Comment : tried 2 loops, more sin & cos functions. The outcome is magnificent, it is so cool. The problem is it is so hard to get things a little bit in order, I don't know it is felt like unordered.

CODE :
---------------------------------------------------------------------------------------------------------------
import math

def setup():
    size(800,800)
    stroke(255)
    smooth()
   
colors = range(5)
colors[0] = color(10,58,74,150)
colors[1] = color(25,106,115,150)
colors[2] = color(50,166,166,150)
colors[3] = color(161, 191, 51,150)
colors[4] = color(200, 217, 74, 150)

def rcfunction():
    if (mouseY<=200):
        rc = colors[0]
    if (mouseY>200) and (mouseY<=400):
        rc = colors[2]
    if (mouseY>400) and (mouseY<=600):
        rc = colors[3]
    if (mouseY>600) and (mouseY<=800):
        rc = colors[4]
    fill(rc)

       
def draw():
    background(240)
    rcfunction()
    for i in range(1,600,2):
        angle = mouseX * i * 0.001
        x = i * 3.14 * math.sin(angle)
        y = i * 3.14 * math.cos(angle)
        width = math.pow(i, -2)
        ellipse(mouseX+x, mouseY+y, width+i*0.2, width+i*0.2)
        rect(mouseX+y, mouseY+x, width+i*0.2, width+i*0.2)
        rect(mouseX+y, mouseY+x, width+i*0.2-10, width+i*0.2-10)
    for ii in range (1,800):
        trans = mouseY + ii
        xx = ii * 6.28 * math.pow(math.sin(trans),2)
        yy = ii * 6.28 * math.pow(math.cos(trans),2)
        width = math.pow(ii, -25)
        ellipse(mouseX+xx, mouseY+yy, width+ii*0.8, width+ii*0.8)
---------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment