
NodeBox Test 1 (Dots)
2 years ago
My first video export/code test from the Python based programming environment NodeBox.
Source Code:
#Begin Source
size(700, 700)
speed(50)
boids = ximport("boids")
reload(boids)
def setup():
global flocks
flocks = []
for i in range(4):
flock = boids.flock(20, 0, 0, WIDTH, HEIGHT)
flock.goal(WIDTH/2, HEIGHT/2, 0)
flocks.append(flock)
def draw():
colormode(HSB)
global flocks
for flock in flocks:
flock.update()
for boid in flock.boids:
r = boid.z / 4
#r += 10
f = boid.fill
#f.a = 0.5+ boid.z/100
fill(random(0,0.8), random(0.2,0.5), 0.8, random(0.9,7.5))
push()
oval(boid.x-r/2, boid.y-r/2, r, r)
pop()
fill(0.01)
oval(250,245,200,200)
fill(240)
fontsize(20)
font("Times")
w = textwidth("your text here")
text("your text here", WIDTH/2-w/2, HEIGHT/2)
# End Source
Source Code:
#Begin Source
size(700, 700)
speed(50)
boids = ximport("boids")
reload(boids)
def setup():
global flocks
flocks = []
for i in range(4):
flock = boids.flock(20, 0, 0, WIDTH, HEIGHT)
flock.goal(WIDTH/2, HEIGHT/2, 0)
flocks.append(flock)
def draw():
colormode(HSB)
global flocks
for flock in flocks:
flock.update()
for boid in flock.boids:
r = boid.z / 4
#r += 10
f = boid.fill
#f.a = 0.5+ boid.z/100
fill(random(0,0.8), random(0.2,0.5), 0.8, random(0.9,7.5))
push()
oval(boid.x-r/2, boid.y-r/2, r, r)
pop()
fill(0.01)
oval(250,245,200,200)
fill(240)
fontsize(20)
font("Times")
w = textwidth("your text here")
text("your text here", WIDTH/2-w/2, HEIGHT/2)
# End Source
-
Vimeo: About / Blog / Developers / Jobs / Community Guidelines / Community Forums / Help Center / Site Map / Merchandise
/ Get Vimeo

Previous Week