1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Colour rectangle star wheel

Posted by brokendrum70 on Jan 04, 2009

Something done in twenty minutes after learning how to mess around with sin(), push() and pop().

If you run this script, you may want to reduce the amount for counter the first time you do.

from math import sin
 
width = 1440
height = 900
sizex = 80
sizey = 10
 
size (width, height)
background (0)
 
# You might want to make counter a smaller number at first
counter = 144000
 
for i in range(0,counter):
    i = i*4
    fill(0.5+((sin(i/9))/2),(sin(i/36))/1,sin(i/10),0.1)
    push()
    translate(300+(sin(i/3.14)*(i/64)),random(-2.0,2.0))
    rect((width-sizex)/2,(height-sizey)/2,sizex,sizey)
    pop()
    rotate (i/random(100.0,200.0))