xforms for Chaotica
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

10 months ago
<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="glitcher">
<node name="input_params">
<real name="glitcher">1</real>
<real name="glitcher_a">1</real>
<real name="glitcher_b">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="a" />
<real name="b" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
glitcher_init_result(glitcher, glitcher_a, glitcher_b)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
x = halfpi() * p_in.x
y = halfpi() * p_in.y
tanhsin = sinh(y)
tanhcos = cosh(y)
tanhsinh = sin(x)
tanhcosh = cos(x)
tanhden = weight / (tanhcos + tanhcosh)
xh = tanhsinh * tanhden
yh = tanhsin * tanhden
xj = a * xh + b * yh + a
yj = b * xh + a * yh + b
root = truncateToInt(abs(weight * 2) * unit_rnd_0)
z = (atan2(yj, xj) + toReal(root) * twopi()) / weight
r = weight * pow(xj * xj + yj * yj, weight)
in
vec2(cos(z), sin(z)) * r
]]>
</string>
</transform_def>
</user_transforms>