diff --git a/outrun.rkt b/outrun.rkt index c36c85c..6994932 100644 --- a/outrun.rkt +++ b/outrun.rkt @@ -108,6 +108,31 @@ 90) 2)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; the static spheres + +(define sspheres + (let* ((calculate-noise-fn + (lambda (f) + (lambda (i j k) + (scale-number (f (scale-number i -10 10 -1 1) + (scale-number j -10 10 -1 1) + (scale-number k -10 10 -1 1)) + -1 1 + 0 1)))) + (noise1 (calculate-noise-fn simplex)) + (noise2 (calculate-noise-fn perlin))) + (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)))))))) + +(define frozen-sspheres (freeze sspheres)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; the lights @@ -128,10 +153,11 @@ (point-at (camera-position s) (camera-direction s))) (make-sunlight (scene-state-dsun s)) - (mesh t) ;; (move-y (road t) -1) - (spheres t) - (scene t) + ;; (spheres t) + ;; (scene t) + frozen-sspheres + (mesh t) )) (define (on-key s n t k)