4cade/res/notes/transitions/iris.py

44 lines
1.6 KiB
Python
Raw Normal View History

2019-10-21 20:00:38 +00:00
#!/usr/bin/env python3
from math import sqrt, sin, cos, pi
2019-11-08 18:29:44 +00:00
import util
2019-10-21 20:00:38 +00:00
2019-10-28 01:18:26 +00:00
radius_x = 280//2
radius_y = 192//2
2019-10-21 20:00:38 +00:00
def f(t):
2019-10-23 13:33:53 +00:00
return (sqrt(t)*cos(2*pi*sqrt(t)), 0.87*sqrt(t)*sin(2*pi*sqrt(t)))
2019-10-21 20:00:38 +00:00
coords = []
for i in range(1000000):
any = False
a, b = f(float(i)/10.0)
x = round(radius_x+a)
y = round(radius_y+b)
if y % 2 != 0:
continue
if x < 0 or x >= radius_x or y < 0 or y >= radius_y:
continue
coords.append((x,y))
2019-11-08 18:29:44 +00:00
unique_coords = util.unique(coords)
unique_vals = util.vals_1bit(unique_coords)
2019-11-29 02:41:38 +00:00
util.write("../../../src/fx/fx.hgr.iris.data.a", unique_vals)
util.write("../../../src/fx/fx.hgr.ripple.data.a", util.ripple(unique_vals))
unique_vals.reverse()
2019-11-29 02:41:38 +00:00
util.write("../../../src/fx/fx.hgr.iris.in.data.a", unique_vals)
2019-10-25 13:14:25 +00:00
corner4_coords = [(139-x,94-y) for (x,y) in unique_coords]
2019-11-27 20:07:28 +00:00
corner4_vals = util.vals_1bit(corner4_coords)
2019-11-29 02:41:38 +00:00
util.write("../../../src/fx/fx.hgr.corner4.in.data.a", corner4_vals)
2019-10-25 13:14:25 +00:00
corner4_vals.reverse()
2019-11-29 02:41:38 +00:00
util.write("../../../src/fx/fx.hgr.corner4.out.data.a", corner4_vals)
util.write("../../../src/fx/fx.hgr.swirl.data.a", util.ripple(util.ripple(corner4_vals)))
mult_coords = util.ripple(util.quadrant_multiply(util.ripple(util.quadrant_multiply(util.ripple(util.quadrant_multiply(unique_coords))))))
util.write("../../../src/fx/fx.hgr.bubbles.data.a", util.vals_1bit(mult_coords))
mult_coords.reverse()
util.write("../../../src/fx/fx.hgr.bubbles.in.data.a", util.vals_1bit(mult_coords))
2019-11-29 03:01:27 +00:00
mult_coords = util.halfripple(util.ripple(util.radial_multiply(util.radial_multiply(unique_coords))))
util.write("../../../src/fx/fx.hgr.radbubbles.data.a", util.vals_1bit(mult_coords))