~dhogan/firefly

1c5fce833912ab16942296a22001d9efa988e40a — Daniel Hogan 6 years ago b6b4f8a master
add a dynamic radial cosine pattern
1 files changed, 21 insertions(+), 0 deletions(-)

A generators/cos.py
A generators/cos.py => generators/cos.py +21 -0
@@ 0,0 1,21 @@
#!/usr/bin/env python

from common import *

frames = 800

for key in color_defs:
	pixel_array = numpy.zeros((frames,x_dim,y_dim,colors))
	
	for t in range(frames):
		for y in range(y_dim):
			for x in range(x_dim):
				for color in range(colors):
					r = numpy.sqrt(((x - (x_dim - 1)/2)**2 + (y - (y_dim - 1)/2)**2)/16) + (t/50)
					pixel_array[t][x][y][color] = numpy.pi * color_defs[key][color] * r 

	pixel_array = gamma(60 * (1 - numpy.cos(pixel_array)))

	output_array = outputify(pixel_array)
	
	save_pattern(output_array, base_name + '_' + key)