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.

43 lines
1.1 KiB

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="variant1">
<node name="input_params">
<real name="variant1">1</real>
<real name="variant1_holes">0</real>
<real name="variant1_eccentricity">0.5</real>
<real name="variant1_rotate">0</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="holes" />
<real name="ecc" />
<real name="rotate" />
</node>
<int name="num_unit_randoms">1</int>
<string name="winter_init_function">
<![CDATA[
variant1_init_result(variant1, variant1_holes, variant1_eccentricity, variant1_rotate)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
rotmat = mat2x2(cos(rotate), -sin(rotate),
sin(rotate), cos(rotate))
d = length(p_in)
r = weight * (unit_rnd_0 - holes) * ecc / (d + ecc * p_in.x)
conic_out = p_in * r
p = rotmat * conic_out
fx = tanh(p_in.x * p.x) + sinh(p_in.y * p.y)
fy = sinh(p_in.y * p.x) - tanh(p_in.x * p.y)
fr = weight * (p.x * p.x + p.y * p.y)
in
vec2(fx, fy) * fr
]]>
</string>
</transform_def>
</user_transforms>