此谢儿宾斯基三角形,原来我与榕老师研究过,榕老师最先造出。原代码太长,且繁杂不堪。今对原代码大势减肥,浓缩成下面代码,再用GSP作之,十分容易,好象效果图没啥两样,大家可对照对照,看看有无问题。
gnd-slope-sierpinski2 {
init:
z1 = #pixel
int done = 2
loop:
IF ((imag(z1)>=.575*real(z1)) && (-.575*real(z1)<=imag(z1)))
z1 = 2*z1-1i
ELSEIF (real(z1)<=0)
z1 = 2*z1+(.8660254, 0.5)
ELSEIF (real(z1)>0)
z1 = 2*z1+(-.8660254, 0.5)
ELSE
z1 = 2*z1
ENDIF
modz = |z1|
done = done + 1
IF (modz > @bailout)
done = 0
ENDIF
bailout:
(done > 0)
default:
title = "Slope Sierpinski Triangle II"
center = (0.0, 0.0)
magn = 1.1538
maxiter = 149
method = multipass
periodicity = 0
param bailout
caption = "Bailout value"
default = 127
min = 1
endparam
} |