返回列表 回复 发帖
这种用到边界距离为参数的做法还是有不尽人意的地方,M集以外的部分会卷起来,我希望它是平的。继续改进中:

5'.JPG (35.29 KB)

5'.JPG

就要成功了,恭贺。
来一张特大图:

12.JPG (68.23 KB)

12.JPG

503# 榕坚
调整一下角度就更好了。
这是用et做为高度参数的结果:

4 (2).JPG (38.09 KB)

4 (2).JPG

480# 柳烟


也扫一张,不知两位老师还有没有相似的曲线类代码?
快照24.jpg
506# xuefeiyang
有啊,不过很难用几何画板完成:
Slope_Apollonian {
; Ron Barnett April 23, 2005
; Implements the mapping algorithm of Susan Chambless
; Implements fBm in the global section using a noise array
; and modification of Damien's fBm code
; Circle perturbations added August 13, 2005
; improved duplicate removal code, November 18, 2005

global:
  int w = 0
  int h = 0
  float Inc = @percentInc*0.01
  float wd = Inc*#width
  float ht = Inc*#height
  int wd2 = round(wd*0.5)
  int ht2 = round(ht*0.5)
  float count[round(#width*(1+@percentInc*0.01)),round(#height*(1+@percentInc*0.01))]
  float agree = 100
  float thresh = @scircle/agree
  int l = 0
  int ir = 0
  int si = 0
  int sj = 0
  bool continue = true
  complex rra = 0
  float rrb = 0
  float c = 0
  float ddx = 0
  float fx = 0.0
  float ffx = 0.0
  float xx = 0.0
  float fy = 0.0
  float ffy = 0.0
  int px = 0
  int py = 0
  float cy = imag(#center)
  float cx = real(#center)
  float txmax = 4.0/#magn
  float tymax = txmax*#height/#width
  float xmin = cx - txmax/2
  float ymin = cy - tymax/2
  int MaxLevel = @level
  int level = MaxLevel
  complex cs[1000000]
  float rad[1000000]
  float ang = 2*#pi/3
  complex ipi = flip(#pi);
  float ar = 0
  float br = 0
  complex a = 0
  complex b = 0
  float temp = 0
  int ii = 0
  int i = 0
  int j = 0
  int k = 0
  int ib = 0
  int start = 0
  int finish = 0
  int lev = 2
  float ddx = 0
  float ddy = 0
  float ddr = 0
  int pert = @pert
  pert = 11 - pert
  float scle2 = 0
  float scle = 0
  if (@ptype == "None")
    scle = 2 + sqrt(3)
    scle2 = 1
  elseif (@ptype == "Outer Circles")
    scle = (2 + sqrt(3))*cos(#pi/(pert+6))
    scle2 = (scle-sqrt(3)-1.5)/0.5
  else  ; distance to origin for base spheres
    scle = 2 + sqrt(3)
    if pert == 10
      scle2 = 1.0041268407
    elseif pert == 9
      scle2 = 1.0049465720
    elseif pert == 8
      scle2 = 1.0060422243
    elseif pert == 7
      scle2 = 1.0075560883
    elseif pert == 6
      scle2 = 1.0097381547
    elseif pert == 5
      scle2 = 1.0130643119
    elseif pert == 4
      scle2 = 1.0185254
    elseif pert == 3
      scle2 = 1.0286754
    elseif pert == 2
      scle2 = 1.0515254
    elseif pert == 1
      scle2 = 1.1277437913
    endif
  endif
  int maxi
  float gsum[round(#width*(1+@percentInc*0.01)),round(#height*(1+@percentInc*0.01))]
  complex gr = (1,1)
  complex gr2 = (0,1) ^ 0.411111111111
  float gfreq = 1.0
  int gi = 0
  complex gp = 0
  float gbx0 = 0
  float gby0 = 0
  float gbx1 = 0
  float gby1 = 0
  float grx0 = 0
  float gry0 = 0
  float grx1 = 0
  float gry1 = 0
  float gb00 = 0
  float gb10 = 0
  float gb01 = 0
  float gb11 = 0
  float gg_b00_0 = 0
  float gg_b10_0 = 0
  float gg_b01_0 = 0
  float gg_b11_0 = 0
  float gg_b00_1 = 0
  float gg_b10_1 = 0
  float gg_b01_1 = 0
  float gg_b11_1 = 0
  float gd = 0.0
  float gu1 = 0
  float gv1 = 0
  float gu2 = 0
  float gv2 = 0
  float gsx = 0
  float gsy = 0
  float ga = 0
  float gb = 0
  complex gpixel=0
  complex gp = 0
  float fsum = 0


;
  while (h < #height+ht)
    while (w < #width+wd)
      gpixel = w/(#width+wd) + flip(h/(#height+ht))
      gp = gpixel * @gnscale * gr + @gnoffset
      gi = @giter
      gfreq = @gfreq
      gsum[w,h] = 0
      WHILE (gi > 0)
        gbx0 = floor(real(gp)) % 256
        gby0 = floor(imag(gp)) % 256
        IF (gbx0 < 0)
          gbx0 = gbx0 + 256
        ENDIF
        IF (gby0 < 0)
          gby0 = gby0 + 256
        ENDIF
        gbx1 = (gbx0 + 1) % 256
        gby1 = (gby0 + 1) % 256

        grx0 = real(gp) - floor(real(gp))
        gry0 = imag(gp) - floor(imag(gp))
        grx1 = grx0 - 1
        gry1 = gry0 - 1

        gb00 = (gbx0^2 % 65536 + gby0)^2 % 65536
        gb10 = (gbx1^2 % 65536 + gby0)^2 % 65536
        gb01 = (gbx0^2 % 65536 + gby1)^2 % 65536
        gb11 = (gbx1^2 % 65536 + gby1)^2 % 65536

       太长了,超出论坛权限,只截取一段。详见UF

Fractal1.jpg (30.59 KB)

Fractal1.jpg

507# 榕坚


具体在public中的哪一个里面?
508# xuefeiyang


在reb.ufm中,这一系列应是UF中难度最大的系列,里面还有四元数做3D的例子。
来一张彩色的:

拟3D-5.JPG (84.37 KB)

拟3D-5.JPG

返回列表