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.

37 lines
990 B

<?xml version="1.0" encoding="utf-8"?>
<user_transforms>
<transform_def name="ponyloafer">
<node name="input_params">
<real name="ponyloafer">1</real>
<real name="ponyloafer_rotate">1</real>
</node>
<node name="internal_params">
<real name="weight" />
<real name="rotate" />
</node>
<string name="winter_init_function">
<![CDATA[
ponyloafer_init_result(ponyloafer, ponyloafer_rotate * quartpi())
]]>
</string>
<string name="winter_eval_function">
<![CDATA[
let
rotmat = mat2x2(cos(rotate), -sin(rotate),
sin(rotate), cos(rotate))
r = weight / (length(p_in))
pony_out = vec2((p_in.x - p_in.y) * (p_in.x + p_in.y) / 2, p_in.x * p_in.y) * r
n = rotmat * pony_out
fx = (vec2(sinh(p_in.x * n.x) + sinh(p_in.y * n.y)).y)
fy = (vec2(tanh(p_in.y * n.x) - tanh(p_in.x * n.y)).x)
fr = (weight * (n.x * n.x + n.y * n.y)) * 2
in
vec2(fy, fx) * fr
]]>
</string>
</transform_def>
</user_transforms>