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.

45 lines
1.2 KiB

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="onesided">
<!-- Original transform by Crystalize. Badass name credited to Thomas AKA Lycium. :D -->
<node name="input_params">
<real name="onesided">1</real>
<real name="onesided_u" minval="-1" maxval="1">1</real>
<real name="onesided_v">-0.5</real>
<real name="onesided_rotate">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="yu" />
<real name="vi" />
<real name="rot" />
</node>
<int name="num_unit_randoms">2</int>
<string name="winter_init_function">
<![CDATA[
onesided_init_result(onesided, onesided_u * twopi() * 2, onesided_v, onesided_rotate)
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
rotm = mat2x2(cos(rot), -sin(rot),
sin(rot), cos(rot))
vr = (unit_rnd_1) + vi
ur = (unit_rnd_0) * yu
xuv = rotm * vec2((1 + (vr / 2) * cos(ur/2)) * cos(ur))
yuv = vec2((1 + (vr / 2) * cos(ur/2)) * sin(ur))
zuv = vec2((vr / 2) * sin(ur / 2))
c = complex(dot(zuv, zuv), zuv.x + zuv.y)
r = xuv + yuv + zuv + vec2(c.re, c.im)
rw = weight
in
r * rw
]]>
</string>
</transform_def>
</user_transforms>