 (defn start-renderer [el positions events]
   (reset! current-positions positions)
 
-  (let [context (render-context el positions events)
+  (let [context (render-context positions events)
         do-render (fn cb []
                     (js/requestAnimationFrame cb)
                     (render context))]
 
+    (.appendChild el (.-domElement (:renderer context)))
+
     (initialise! context)
     (do-render)))

    (set! (.. light -position -z) 130)

    (.setSize renderer width height)
    (.appendChild el (.-domElement renderer))

    (doseq [pos positions]
      (add-block! scene pos))


        (.render renderer scene camera)))))

(defn render-context [positions events]
  (let [width (.-innerWidth js/window)
        height (.-innerHeight js/window)]
    (map->RenderContext
     {:positions positions
      :events events

      :scene (reset! scene (js/THREE.Scene.))
