返回列表 回复 发帖
我想问问这种着色算法是否是原榕坚兄的那个算法?我觉得好象是.另常老师发的源文件,我将其放大后,增大迭代次数,枝丫太粗了,这是什么原因呢?
未命名.jpg
谢谢常老师,按你说的调了调,枝丫变细了,图形真漂亮.
未命名.jpg
GSP这软件,毕竟是小软件.
Lighting {
;
; Coloring algorithm for the Slope family of fractal types.
; This coloring algorithm performs 3D lighting for these
; fractals.
;
; Written by Damien M. Jones
;
final:
  float vz = -sqrt(1-|#z|)                ; extract implied portion of normal
  float d2r = #pi/180                        ; degrees to radians conversion factor

  ; create vector for light direction
  float lx = cos((270-@angle)*d2r) * cos(@elevation*d2r)
  float ly = sin((270-@angle)*d2r) * cos(@elevation*d2r)
  float lz = -sin(@elevation*d2r)

  ; compute cosine of angle between these vectors
  ; (this is the amount of lighting on the surface)
  float l = lx*real(#z) + ly*imag(#z) + lz*vz
  IF (l < @ambient)                        ; light is below the ambient level
    l = @ambient                        ; set it to the ambient level
  ENDIF
  IF (@ambient < 0)                        ; the ambient level is negative
    l = l + 1                                ; offset to prevent clipping at 0
  ENDIF
  #index = l*0.99                        ; reduce it just a bit to prevent
                                          ; the colors from wrapping

default:
  title = "Lighting"
  helpfile = "Uf*.chm"
  helptopic = "Html/coloring/standard/lighting.html"
  heading
    text = "Tip: Combine with one of the Slope formulas"
  endheading

  param @angle
    caption = "Light Rotation"
    default = 90.0
    hint = "Gives the rotation of the light source, in degrees. With 0 \
            degrees, the light comes from above. Positive values give \
            clockwise rotation."
  endparam
  param @elevation
    caption = "Light Elevation"
    default = 30.0
    hint = "Gives the elevation of the light source, in degrees."
  endparam
  param @ambient
    caption = "Ambient Light"
    default = 0.0
    min = -1.0
    max = 1.0
    hint = "Specifies the level of ambient light.  Use -1.0 to \
            color all surfaces."
  endparam
}
UF中的这一光照特效,在UF中如何玩,我不知如何在UF中玩这个特效?
今天试着学习三角不等式作色,费了九牛二虎力气,结果数据溢出太多,任随调整阀值,等势圈变化不大,手艺越来越差劲了。好久不弄,dem等东西,丢得太深了,要复习一下才行。
查昨天错误,发现原来没有对sum进行缩放的原故。真是生疏了,生疏了。
changxde老师好,昨天学习你的此大帖三角不等式作色法,我按你的UF-TTA 文件进行学习,昨天因为sum迭代中没有进行迭代,所以扫出的图差别太大。今天按你的文件造作画板文件,按id作色,等势环带没法消除。而在你的文件中,直接按id作色,在M集外部却正常,查了个把钟点,不知我那文件问题出在那?我将文件发上来,你帮忙看看,谢谢。我文件中的符号一如你文件中的符号,方便看阅。
三角不等式练习原因查找.gsp (68.29 KB)
谢过向老师,确实问题出在这,我检查到这步,一直没发现问题,以为是用商对数公式等于对数之差,估计再检查二十遍,仍然难以发现,旁观者清,当局者迷呀。非常感谢并问好。
按向老师所指出的错误,改正后,想不到又横生枝节:
未命名.jpg
不知何故?不知是不是我那Dem法有问题
返回列表