附我编写一个UF的三圆环陷阱的ucl文件代码:
3圆环陷阱柳烟 {
;
init:
int iter = 0
float x = 0
float y = 0
float Dsgd1 = 0
float Dsgd2 = 0
float Dsgd3 = 0
float Circle = 0
float ZtoPsqd = 0
float Rc = @r
float H=@h
bool Trapped = false
loop:
iter = iter + 1
x = real(#z)
y = imag(#z)
if iter > @skip && !Trapped
Dsgd1 =abs(sqrt((x-@o1x)^2+(y-@o1y)^2)-Rc)
Dsgd2 =abs(sqrt((x-@o2x)^2+(y-@o2y)^2)-Rc)
Dsgd3=abs(sqrt((x-@o3x)^2+(y-@o3y)^2)-Rc)
if Dsgd1 <H && Dsgd2>=H
Trapped = true
ZtoPsqd= Dsgd1
Circle = 1
elseif Dsgd2 <H&&Dsgd3>=H
Trapped = true
ZtoPsqd= Dsgd2
Circle = 2
elseif Dsgd3 < H&&Dsgd1>=H
trapped = true
ZtoPsqd = Dsgd3
Circle = 3
endif
endif
final:
if !trapped
#solid = true
else
Circle = (Circle + @off) % 8
float Ratio = ZtoPsqd/H
float ColorIndex = 29 * Ratio + Circle * 30
#index = (ColorIndex + 1) % 256 /256
endif
default:
title = "柳烟的三圆环陷阱"
param r
caption = "Circle radius"
default = 1.4
endparam
param h
caption = "h"
default = 0.2
endparam
param skip
caption = "Iters to skip"
default = 0
hint = "Iterations to skip."
endparam
param o1x
caption = "o1x"
default =0.2
endparam
param o1y
caption = "o1y"
default =0.9
endparam
param o2x
caption = "o2x"
default =-0.2
endparam
param o2y
caption = "o2y"
default =-0.9
endparam
param o3x
caption = "o3x"
default =1.2
endparam
param o3y
caption = "o3y"
default =0.0
endparam
param off
caption = "Hue cycle"
default = 0
min = 0
max = 7
hint = "This rotates the coloring order of the balls."
endparam
}
大家可放到UF中,将里面的范例文件,用此陷阱看看,美妙之极。比玩GSP快速并迅速欣赏美图。 |