Add noise-gradient-fractal-value function (similar to noise-fractal-value, but use noise-gradient-value instead of noise-value).
This commit is contained in:
parent
2690a9c527
commit
9e4f49ab04
|
@ -9,7 +9,8 @@
|
|||
make-noise
|
||||
noise-value
|
||||
noise-gradient-value
|
||||
noise-fractal-value)
|
||||
noise-fractal-value
|
||||
noise-gradient-fractal-value)
|
||||
|
||||
; Structure
|
||||
(struct s-noise
|
||||
|
@ -185,3 +186,18 @@
|
|||
coords)))))
|
||||
0
|
||||
(build-list octaves values)))
|
||||
|
||||
; Same as above, but use the noise-gradient-value instead of the noise-value
|
||||
(define (noise-gradient-fractal-value ns octaves persistance . coords)
|
||||
(foldl
|
||||
(lambda (i res)
|
||||
(+ res
|
||||
(* (expt persistance i)
|
||||
(apply
|
||||
noise-gradient-value
|
||||
ns
|
||||
(map
|
||||
(lambda (x) (* (+ i 1) x))
|
||||
coords)))))
|
||||
0
|
||||
(build-list octaves values)))
|
||||
|
|
Loading…
Reference in New Issue