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.

40 lines
1.1 KiB

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="toroidal_eye">
<node name="input_params">
<real name="toroidal_eye">1</real>
<real name="toroidal_eye_shift1">0</real>
<real name="toroidal_eye_shift2">0</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="shift1" />
<real name="shift2" />
<real name="scale1" />
<real name="scale2" />
</node>
<string name="winter_init_function">
<![CDATA[
let
scale1 = 1 - cosh(toroidal_eye_shift1 * toroidal_eye_shift1) * pi()
scale2 = 1 - sinh(toroidal_eye_shift2 * toroidal_eye_shift2) * twopi()
in
toroidal_eye_init_result(toroidal_eye, toroidal_eye_shift1, toroidal_eye_shift2, scale1, scale2)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
rad = 2 / log(dot(p_in, p_in))
x = rad * p_in.x + (shift1 * p_in.x)
y = rad * p_in.y + (shift2 * p_in.y)
rad2 = weight * (scale1 * scale2) / (x * x + y * y)
in
vec2(x * rad2 + shift1, y * rad2 + shift2) * (weight * pi()) / 2
]]>
</string>
</transform_def>
</user_transforms>