此扫描框好象没有到软件中的直角坐标系,这就好,免得坐标系障眼。
用新扫描框,将UF中的一分形的所有数据,整个抬进这新扫描框,扫图:
将UF中的代码,用大刀阔斧砍掉后的精简代码作成,大家闲遐时可整整,颇有意思的。
gnd-slope-sierpinski2 {
; Based on a formula by Ramiro Perez
; Slope version by Gilles Nadeau, 2007
init:
z1 = #pixel
z2 = #pixel + @offset
z3 = #pixel + flip(@offset)
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
IF ((imag(z2)>=.575*real(z2)) && (-.575*real(z2)<=imag(z2)))
z2 = 2*z2-1i
ELSEIF (real(z2)<=0)
z2 = 2*z2+(.8660254, 0.5)
ELSEIF (real(z2)>0)
z2 = 2*z2+(-.8660254, 0.5)
ELSE
z2 = 2*z2
ENDIF
IF ((imag(z3)>=.575*real(z3)) && (-.575*real(z3)<=imag(z3)))
z3 = 2*z3-1i
ELSEIF (real(z3)<=0)
z3 = 2*z3+(.8660254, 0.5)
ELSEIF (real(z3)>0)
z3 = 2*z3+(-.8660254, 0.5)
ELSE
z3 = 2*z3
ENDIF
e1= exp^(-cabs(z1))
e2 = exp^(-cabs(z2))
e3 = exp^(-cabs(z3))
done = done + 1 ; increment iteration counter
IF (modz > @bailout || \
@everyiter || \
done == 149 + 2) ; done, or every iteration, or last
; determine continuous iteration (height) for each point
vx = e2-e1
vy = e3-e1
vz = -@offset
z = vx + flip(vy) ; fudge z from vector
ELSE ; didn't compute z this time
z = z1 ; use primary iteration value to keep ; periodicity working
ENDIF
IF (modz > @bailout) ; we're done
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
float param version
default = 1.1
visible = false
endparam
param bailout
caption = "Bailout value"
default = 127
min = 1
endparam
param offset
caption = "Orbit Separation"
default = 0.01
hint = "Defines how far apart the simultaneous orbits are. Smaller \
distances will produce more accurate results."
endparam
param everyiter
caption = "Every Iteration"
default = false
hint = "If set, the surface normal will be computed at every \
iteration. If you are using a coloring algorithm which \
processes every iteration, you will need this."
endparam
} |