modify spheres
This commit is contained in:
parent
d617210b5f
commit
e29896e292
37
outrun.rkt
37
outrun.rkt
|
@ -11,10 +11,15 @@
|
|||
(define init-scene-state
|
||||
(scene-state #f 0 0 0 0))
|
||||
|
||||
(current-material (material #:ambient 0.1
|
||||
#:diffuse 0.6
|
||||
#:specular 0.3
|
||||
#:roughness 0.5))
|
||||
;; (current-material (material #:ambient 0.1
|
||||
;; #:diffuse 0.6
|
||||
;; #:specular 0.3
|
||||
;; #:roughness 0.5))
|
||||
|
||||
(current-material (material #:ambient 0.05
|
||||
#:diffuse 0.70
|
||||
#:specular 0.25
|
||||
#:roughness 0.1))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; the wavy road thingie
|
||||
|
@ -111,7 +116,7 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; the static spheres
|
||||
|
||||
(define sspheres
|
||||
(define (sspheres amount)
|
||||
(let* ((calculate-noise-fn
|
||||
(lambda (f)
|
||||
(lambda (i j k)
|
||||
|
@ -121,17 +126,21 @@
|
|||
-1 1
|
||||
0 1))))
|
||||
(noise1 (calculate-noise-fn simplex))
|
||||
(noise2 (calculate-noise-fn perlin)))
|
||||
(noise2 (calculate-noise-fn perlin))
|
||||
(random-position (lambda ()
|
||||
(pos (* (- (random) 0.5) 15)
|
||||
(* (- (random) 0.5) 15)
|
||||
(* (- (random) 0.5) 15)))))
|
||||
(combine
|
||||
(for*/list ([i (in-range -10 10)]
|
||||
[j (in-range -10 10)]
|
||||
[k (in-range -10 10)]
|
||||
#:when (< (random) 0.31))
|
||||
(with-color
|
||||
(rgba (noise1 i j k) (noise1 k j i) (noise2 i j k))
|
||||
(sphere (pos i j k) (* 0.25 (+ (random) 0.1))))))))
|
||||
(for/list ([_ (in-range amount)])
|
||||
(match-let* ([(pos i j k) (random-position)]
|
||||
[red (noise1 i j k)]
|
||||
[green (noise2 i j k)]
|
||||
[blue (noise1 red green 0)])
|
||||
(with-color (rgba red green blue)
|
||||
(sphere (pos i j k) (* 0.25 (+ (random) 0.1)))))))))
|
||||
|
||||
(define frozen-sspheres (freeze sspheres))
|
||||
(define frozen-sspheres (freeze (sspheres 1000)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; the lights
|
||||
|
|
Loading…
Reference in New Issue