~jakob/lisp-raytracer-zoo

a4a81ba53c1adcefb38c2238f38ff8e0c3cc8094 — Jakob L. Kreuze 4 months ago fc80db0
[cl] Fix `ray-color'.
1 files changed, 2 insertions(+), 2 deletions(-)

M cl-raytracer.lisp
M cl-raytracer.lisp => cl-raytracer.lisp +2 -2
@@ 294,8 294,8 @@ format (PPM), writing the result to `(current-output-port)'."

(defun ray-color (r)
  "Return an arbitrary color for R."
  (let* ((y (vec3-y (ray-direction r)))
         (time (* 0.5 (+ y 1.0))))
  (let-match* (((vector _ y _) (ray-direction r))
               (time (* 0.5 (+ y 1.0))))
    (list (round (* 255 (lerp 1.0 0.5 time)))
          (round (* 255 (lerp 1.0 0.7 time)))
          (round (* 255 (lerp 1.0 1.0 time))))))