M集TruchetTiles(BOTH)特效:
附上UF中该特效作色的程序代码:
TruchetTiles(BOTH) {
; By Samuel Monnier, 31.10.00
init:
z = 0
zc = 0
zz = 0
cr = 0
float d1 = 0
float d2 = 0
loop:
final:
z = #z/@size*exp(1i*pi/180*@rot)
zc = round(z)
zz = z - zc
cr = 2*(@seed/(zc+124) - round(@seed/(zc+124)))
if real(cr) > 0
if @mode == 0
d1 = abs(cabs(zz+(.5,.5))-.5)
d2 = abs(cabs(zz-(.5,.5))-.5)
else
d1 = abs(real(zz) - imag(zz) -.5)
d2 = abs(real(zz) - imag(zz) +.5)
endif
if d2 < d1
d1 = d2
endif
else
if @mode == 0
d1 = abs(cabs(zz+(.5,-.5))-.5)
d2 = abs(cabs(zz-(.5,-.5))-.5)
else
d1 = abs(real(zz) + imag(zz) -.5)
d2 = abs(real(zz) + imag(zz) +.5)
endif
if d2 < d1
d1 = d2
endif
endif
#index = d1^@thick
default:
title = "Truchet Tiles"
helpfile = "sam-help/variouscol2.htm"
helptopic = "truchet"
param mode
caption = "Mode"
default = 0
enum = "Roundy" "Squarry"
endparam
param size
caption = "Pattern Size"
default = 1.0
endparam
param rot
caption = "Pattern Rotation"
default = 0.0
endparam
param thick
caption = "Thickness"
default = 0.1
endparam
param seed
caption = "Seed"
default = 1234567890
endparam
} |