       accelerate-balls
       move-balls))
 
-
-(def geometry (THREE.BoxGeometry. 0.2 0.3 0.1))
-(def material (THREE.MeshBasicMaterial. #js {"color" 0xffffff "wireframe" true}))
+(def geometry (THREE.SphereGeometry. 0.2 0.3 0.1))
+(def material (THREE.MeshPhongMaterial. #js {"color" 0xffffff
+                                             "specular" 0x555555
+                                             "shininess" 30}))
 
 (defn add-items-to-scene [scene model]
-  (doseq [ball (:balls model)]
-    (prn (str  "Adding: " ball))
+  (doseq [ball (conj (:balls model) (:attractor model))]
+    (prn (str "Adding: " ball))
     (let [ball-mesh (THREE.Mesh.
                       geometry
                       material)]


(def WIDTH 600)
(def HEIGHT 600)
(def attractor-acceleration 0.04)
(def max-velocity 2)

(defonce scene (THREE.Scene.))
(def camera (THREE.PerspectiveCamera. 75 (/ WIDTH HEIGHT) 0.2 1000))
(defonce renderer (THREE.WebGLRenderer. #js {"antialias" true}))

(.setPixelRatio renderer js.window.devicePixelRatio)
(.setSize renderer WIDTH HEIGHT)

(defonce x (.appendChild (.getElementById js/document "main") renderer.domElement))

(defonce model (atom {:attractor {:pos [0 0]}
                      :balls     (for [n (range 1 10)]
                                   {:id n :pos [(* n 0.4) 0] :velocity [0 0.3] :acceleration [0 0]})}))



(defonce initial-setup
         (do
           (prn "Initial setup")
           (add-items-to-scene scene @model)
           (mainloop)))