Skip to content

Commit 34fca16

Browse files
committed
Added grid_lights
1 parent ac79190 commit 34fca16

File tree

3 files changed

+135
-8
lines changed

3 files changed

+135
-8
lines changed

Diff for: fuzz/fuzz.pyde

+17-8
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,19 @@ frame_rate = 30
3232
w = 1000 # width
3333
h = 1000 # height
3434

35-
opacity = 20
35+
opacity = 3
3636

37-
divisions = 8
37+
divisions = 6
3838

3939
a_step = PI/100
4040
angles_1 = helper.range_float(0, 3*(TWO_PI+a_step), a_step)
4141
angles_2 = helper.range_float(0+TWO_PI/3, 3*(TWO_PI+TWO_PI/3+a_step), a_step)
4242
angles_3 = helper.range_float(0+2*TWO_PI/3, 3*(TWO_PI+2*TWO_PI/3+a_step), a_step)
4343

44+
angles_1 = [random(x, x+a_step) for x in angles_1]
45+
angles_2 = [random(x, x+a_step) for x in angles_2]
46+
angles_3 = [random(x, x+a_step) for x in angles_3]
47+
4448
################################################################################
4549
# setup()
4650
# function gets run once at start of program
@@ -59,10 +63,10 @@ def setup():
5963
# Set the number of frames per second to display
6064
frameRate(frame_rate)
6165

62-
background(0, 0, 100)
66+
background(0, 0, 25)
6367

6468
# Stops draw() from running in an infinite loop (should be last line)
65-
noLoop() # Comment to run draw() infinitely (or until 'count' hits limit)
69+
#noLoop() # Comment to run draw() infinitely (or until 'count' hits limit)
6670

6771

6872
################################################################################
@@ -71,27 +75,32 @@ def setup():
7175
################################################################################
7276

7377
def draw():
74-
78+
stroke(60, 7, 86, opacity)
7579
a = angles_1[frameCount]
76-
stroke(180, 100, 100, opacity) # cyan
80+
#stroke(180, 100, 100, opacity) # cyan
81+
#stroke(16.3, 28.6, 96.1) # salmon
7782
x_circle, y_circle = helper.circle_points(w/2, h/2, 100, a)
7883
for row in range(1, divisions):
7984
for col in range(1, divisions):
8085
x = col * w/divisions
8186
y = row * h/divisions
8287
line(x, y, x_circle, y_circle)
8388

89+
stroke(60, 7, 86, opacity)
8490
a = angles_2[frameCount]
85-
stroke(300, 100, 100, opacity) # magenta
91+
#stroke(300, 100, 100, opacity) # magenta
92+
#stroke(348.7, 50.4, 94.9) # bright salmon
8693
x_circle, y_circle = helper.circle_points(w/2, h/2, 100, a)
8794
for row in range(1, divisions):
8895
for col in range(1, divisions):
8996
x = col * w/divisions
9097
y = row * h/divisions
9198
line(x, y, x_circle, y_circle)
9299

100+
stroke(60, 7, 86, opacity)
93101
a = angles_3[frameCount]
94-
stroke(60, 100, 100, opacity) # yellow
102+
#stroke(60, 100, 100, opacity) # yellow
103+
#stroke(45.7, 78.8, 94.1) # yellow
95104
x_circle, y_circle = helper.circle_points(w/2, h/2, 100, a)
96105
for row in range(1, divisions):
97106
for col in range(1, divisions):

Diff for: grid_lights/grid_lights.pyde

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
################################################################################
2+
# Aaron Penne
3+
# https://github.com/aaronpenne
4+
################################################################################
5+
6+
import datetime
7+
import string
8+
import sys
9+
from random import shuffle, seed
10+
11+
import helper
12+
13+
################################################################################
14+
# Global variables
15+
################################################################################
16+
17+
random_seed = int(random(0, 10000))
18+
random_seed = helper.get_seed(random_seed)
19+
helper.set_seed(random_seed)
20+
21+
# Get time
22+
timestamp = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')
23+
24+
# Parameters for draw speed
25+
frame_rate = 30
26+
27+
################################################################################
28+
# Knobs to turn
29+
################################################################################
30+
31+
# Canvas size
32+
w = 1000 # width
33+
h = 1000 # height
34+
35+
opacity = 3
36+
37+
divisions = 6
38+
39+
a_step = PI/100
40+
angles_1 = helper.range_float(0, 3*(TWO_PI+a_step), a_step)
41+
angles_2 = helper.range_float(0+TWO_PI/3, 3*(TWO_PI+TWO_PI/3+a_step), a_step)
42+
angles_3 = helper.range_float(0+2*TWO_PI/3, 3*(TWO_PI+2*TWO_PI/3+a_step), a_step)
43+
44+
angles_1 = [random(x, x+a_step) for x in angles_1]
45+
angles_2 = [random(x, x+a_step) for x in angles_2]
46+
angles_3 = [random(x, x+a_step) for x in angles_3]
47+
48+
################################################################################
49+
# setup()
50+
# function gets run once at start of program
51+
################################################################################
52+
53+
def setup():
54+
# Sets size of canvas in pixels (must be first line)
55+
size(w, h, P3D)
56+
57+
# Sets resolution dynamically (affects resolution of saved image)
58+
pixelDensity(displayDensity()) # 1 for low, 2 for high
59+
60+
# Sets color space to Hue Saturation Brightness with max values of HSB respectively
61+
colorMode(HSB, 360, 100, 100, 100)
62+
63+
# Set the number of frames per second to display
64+
frameRate(frame_rate)
65+
66+
background(0, 0, 25)
67+
68+
# Stops draw() from running in an infinite loop (should be last line)
69+
#noLoop() # Comment to run draw() infinitely (or until 'count' hits limit)
70+
71+
72+
################################################################################
73+
# draw()
74+
# function gets run repeatedly (unless noLoop() called in setup())
75+
################################################################################
76+
77+
def draw():
78+
79+
count = (frameCount)
80+
background(0, 0, 20)
81+
82+
directionalLight(0, 0, 95, 0, 0, -10)
83+
ambientLight(0, 0, 50)
84+
85+
stroke(0, 0, 20)
86+
fill_dark = 107
87+
translate(-500, -500, 950)
88+
for z in range(0, 10):
89+
fill_dark -= 9
90+
fill(0, 0, fill_dark)
91+
translate(0, 0, -500)
92+
for x in range(-3*w, 2*w, 300):
93+
for y in range(-3*h, 2*h, 300):
94+
# Circles
95+
ellipse(x+count, y+count, 30, 30)
96+
97+
# Spheres
98+
# pushMatrix()
99+
# translate(x+count, y+count)
100+
# sphere(30)
101+
# popMatrix()
102+
103+
104+
#helper.save_frame_timestamp('grid_lights', timestamp, random_seed)
105+
106+
# Save memory by closing image, just look at it in the file system
107+
# if (w > 1000) or (h > 1000):
108+
# exit()
109+
110+
111+
################################################################################
112+
# Functions
113+
################################################################################
114+
115+
def mousePressed():
116+
helper.save_frame_timestamp('fuzz', timestamp, random_seed)

Diff for: grid_lights/sketch.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mode=Python
2+
mode.id=jycessing.mode.PythonMode

0 commit comments

Comments
 (0)