返回列表 回复 发帖
UF中的有些特效太迷人,但破译起来太费神,判断多,令人眼花了乱,只好放弃了。
19# 榕坚
完全正确。
22# dyk
应该是这样的。我们也对E文一窍不通,只是按代码程序,大概加估计进行的。
25# 榕坚
说得太好了!今天搞了几个特效,以失败告终。今晚搞另一个,失败了好几次,终于迎来希望的曙光。
mt-weave {
; Mark Townsend, 15 November 2000
final:
  float this = 0
  float that = 0
  float x = 4096 + real(#z) * @size
  float y = 4096 + imag(#z) * @size
  int xi = floor(x)
  int yi = floor(y)
  float xr = x - xi
  float yr = y - yi
  float s = (1 - @width) / 2
  if @shading == 0
    this = yr
    that = xr
  else
    this = xr
    that = yr
  endif  
  if (xi + yi) % 2 == 0
    if (yr > s)&& (yr < 1 - s)
      #index = this
    else
      if (xr > s)&& (xr < 1 - s)
        #index = that
      else
        #solid = true
      endif
    endif  
  else
    if (xr > s) && (xr < 1 - s)
      #index = that
    else
      if (yr > s) && (yr < 1 - s)
        #index = this
      else
        #solid = true
      endif
    endif  
  endif
default:
  title = "Weave"
  param shading
    caption = "Shading"
    enum = "Thread" "Ribbon"
  endparam
  param width
    caption = "Width"
    default = 0.9
    max = 1.0
  endparam
  param size
    caption = "Scale"
    default = 1.0
  endparam  
}
未命名.jpg
未命名.jpg
weave特效.gsp (24.91 KB)
将就UF胚胎,擅自变动程序,扫UF没有的:
未命名.jpg
bezier-curve {
; Kerry Mitchell 08apr00
;
; Colors by the orbit's closest approach to a user-defined Bezier curve.
; The curve is determined by specifying beginning and ending anchor points,
; through which the curve passes, and 2 control points, which influence the
; shape of the curve.
;
init:
  float x0=real(@z0)
  float y0=imag(@z0)
  float x1=real(@z1)
  float y1=imag(@z1)
  float x2=real(@z2)
  float y2=imag(@z2)
  float x3=real(@z3)
  float y3=imag(@z3)
  float cx=3*(x1-x0)
  float bx=3*(x2-x1)-cx
  float ax=x3-x0-cx-bx
  float cy=3*(y1-y0)
  float by=3*(y2-y1)-cy
  float ay=y3-y0-cy-by
  float t=0.0
  float r=0.0
  float x=0.0
  float y=0.0
  float u=0.0
  float v=0.0
  int iter=0
  float rmin=1.0e20
  int itermin=0
  zmin=(0.0,0.0)
loop:
  iter=iter+1
  u=real(#z)
  v=imag(#z)
;
; The curve is parameterized with x(t) and y(t).  Step through several t
; values to find the nearest approach of the orbit to the curve.
;
  t=0.0
  while(t<=1.0)
    x=((ax*t+bx)*t+cx)*t+x0
    y=((ay*t+by)*t+cy)*t+y0
    r=(x-u)*(x-u)+(y-v)*(y-v)
    if(r<rmin)
      rmin=r
      itermin=iter
      zmin=#z
    endif
    t=t+@dt
  endwhile
final:
  if(@colorby==1)            ; iteration @ min
    #index=0.01*itermin
  elseif(@colorby==2)        ; angle @ min
    t=atan2(zmin)
    t=t/pi
    if(t<0.0)
      t=t+2.0
    endif
    #index=0.5*t
  elseif(@colorby==3)        ; draw section
    u=real(#pixel)
    v=imag(#pixel)
    t=0.0
    rmin=1e20
    while(t<=1.0)
      x=((ax*t+bx)*t+cx)*t+x0
      y=((ay*t+by)*t+cy)*t+y0
      r=(x-u)*(x-u)+(y-v)*(y-v)
      if(r<rmin)
        rmin=r
      endif
      t=t+@dt
    endwhile
    #index=rmin^@nexp
  else                       ; minimum distance
    #index=rmin^@nexp
  endif
default:
  title="Bezier Curve"
  helpfile="lkm-help\lkm-bezier.html"
  param z0
    caption="1st anchor point"
    default=(1.0,0.0)
    hint="Curve starts at this point."
  endparam
  param z1
    caption="1st control point"
    default=(1.0,1.0)
    hint="Influences the shape of the curve."
  endparam
  param z2
    caption="2nd control point"
    default=(0.0,0.0)
    hint="Influences the shape of the curve."
  endparam
  param z3
    caption="2nd anchor point"
    default=(0.0,1.0)
    hint="Curve ends at this point."
  endparam
  param dt
    caption="step size"
    default=0.1
    hint="Decrease for smoother line, increase \
      to see dots.  Should be between 0 & 1."
    min=0.0
    max=1.0
  endparam
  param nexp
    caption="power"
    default=0.1
    min=0.0
    hint="Decrease to make thinner lines. Use \
      with 'minimum distance' coloring."
  endparam
  param colorby
    caption="color by"
    default=0
    enum="minimum distance" "iteration @ min" \
      "angle @ min" "show curve"
  endparam
}
UF中效果图:
Fractal2.jpg
我干了两天,劳而无功。
这是我扫出的较为接近的病态文件:
未命名.jpg
好象是等势圈将金链子盖住了。
我是先按照着色程序中的t到t+dt,由判断t<=1,迭代9次,得到rmin后,将所有的z都试过,替换u\v,不成。又将9次得到的rmin,再将z^2+c或按p缩放后的点替换程序中的u\v,再二次迭代,得到终点rmin的终点,再得到index,没有引进et,仍有等势圈。
观上图,比我扫出的,更接近原图,请问迭代规则是如何弄的?
36# 榕坚
应该非常慢,我弄出的魇品,扫起来都慢如蜗牛。
返回列表