返回列表 回复 发帖

UF与复分形特效

M集TruchetTiles(BOTH)特效:
未命名.jpg
附上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
}
2# xiaongxp
一次扫成的。
改变参数,再扫:
未命名.jpg
UF中的这个特效带两个开关项,要在一个画板文件中,整合这两个开关项,不难,无非多几个判断而已。分形着色,用了本坛榕坚兄发在该坛的一种特效中的着色法。一楼图是其中一个开关项之一,今再扫其姐妹篇:
未命名.jpg
一楼的画板源文件,待我整理好后,再发在此。大家一同努力,将分形推向高潮。
附上1楼的源文件,以方便交流:
M集TruchetTiles(BOTH)特效.gsp (28.41 KB)
将程序代码中的某些句子动一动,扫得一图:
未命名.jpg
8# 榕坚
说得不错,UF确实是学习复分形的绝好教材,是分形艺术的“敦煌莫高窟”。
这个复分形没整成功,程序解读起来费神,弄来不对头,等势圈老是不能消亡了。摆出来,算是征解。不过,倒学会了扫描法扫出国际象棋棋盘:
Fractal2.jpg
国际象棋棋盘:
未命名.jpg
国际象棋棋盘扫法(更新).gsp (16.33 KB)
我刚才胡整海整,歪打正着,居然作出了,怪哉!我今天就干这个特效,总是带来整去不对劲,感谢上天。
未命名.jpg
M集CheckerBoard特效.gsp (23.38 KB)
CheckerBoard {
; Marcelo Anelli
  ; Caution!!:
  ; this method does not work with fast Mandel and fast Julia.
  init:
    float p = 0.0
    float w = 320 / #width * 0.03 * sqrt(@p1)
    int tx = 0
    int ty = 0
    float rx = real( #screenpixel )
    float ry = imag( #screenpixel )
    tx = floor( rx * w )
    if @ratio
      ty = floor( ry * w * #width / #height )
    else
      ty = floor( ry * w )
    endif
    int t = ( tx + ty ) % 2
    if (t == 0)
      p = @pmin
    else
      p = @pmax
    endif
  final:
    #index = p
default:
  title = "CheckerBoard"
  param p1
    caption = "Width"
    default = 1.0
    hint = "Not depending of magnification."
  endparam
  param ratio
    default = false
    caption = "Aspect ratio"
    hint = "Enable to match the aspect ratio of the square and the image"
  endparam
  param pmin
    caption = "White Square Color"
    min = 0.0
    max = 1.0
    default = 0.1
  endparam
  param pmax
    caption = "Black Square Color"
    min = 0.0
    max = 1.0
    default = 0.7
  endparam
}
未命名.jpg
未命名.jpg
未命名.jpg
12# 榕坚
不同的着色模式,引发不同的视觉冲击。再扫一图:
未命名.jpg
特效代码如下:
FamilyGradient(BOTH) {
; By Samuel Monnier, 20.3.00
; Designed for the "Familly formulas"
; (Julifamilly and Pcfamilly in my file
; and Pinskyfamilly in kpk.ufm.
init:
  complex z = pixel
  complex zc = 0
loop:
  
final:
  z = z - @tilem
  z = z*exp(1i*pi/180*@rottile)
  zc = round(z/@sizesq)*@sizesq
  z = z*exp(-1i*pi/180*@rottile)
  zc = zc*exp(-1i*pi/180*@rottile)
  z = z + @tilem
  zc = zc + @tilem
  z = 2*(z - zc)/@sizesq
  z = z*exp(1i*pi/180*@rottile)
  if @mode == 0
    #index = cabs(z)
  elseif @mode == 1
    float x = abs(real(z))
    float y = abs(imag(z))
    if x > y
      #index = x
    else
      #index = y
    endif
  endif
default:
  title = "Gradient for <<Familly>>"
  helpfile = "sam-help/variouscol.htm"
  helptopic = "gradforfam"
  
  param mode
    caption = "Gradient Mode"
    default = 1
    enum = "Circles" "Squares"
  endparam
  
  param tilem
    caption = "Tiling displacement"
    default = (0,0)
  endparam

  param sizesq
    caption = "Size of the tiles"
    default = 0.6
  endparam

  param rottile
    caption = "Tiling rotation"
    default = 0.0
  endparam
}
返回列表