 
 (def canvas (create-canvas w h))
 
-(def windows (show-window canvas "raymarching" w h 15))
+(def window (show-window canvas "raymarching" w h 15))
 
 (defmethod key-pressed ["raymarching" \space] [_]
   (save-canvas canvas "results/ex22/scene.jpg"))

(defn normal
  ""
  [f ^Vec3 v t]
  (let [eps (max 0.02 (* 0.001 t))]
    (v/normalize (Vec3. (- (f (- (.x v) eps) (.z v))
                           (f (+ (.x v) eps) (.z v)))
                        (+ eps eps)

          h (max 0.0 (f (.x p) (.z p)))
          newres (min res (/ (* k h) t))]
      (if (or (< h 0.0001)
              (> i 20))
        (m/constrain newres 0.0 1.0)
        (recur (unchecked-inc i) newres (+ t (m/constrain h 0.02 0.5)))))))


(def terrain-f (comp (var/make-variation :sinusoidal 1.2 {})
                     (var/make-variation :auger 0.7 {})))

(defn terrain
  ""
