 
 (def WIDTH 600)
 (def HEIGHT 600)
-(def attractor-acceleration 0.04)
-(def max-velocity 2)
+(def attractor-acceleration 0.01)
+(def max-velocity 0.2)
 
 (defonce scene (THREE.Scene.))
 (def camera (THREE.PerspectiveCamera. 75 (/ WIDTH HEIGHT) 0.2 1000))
 (defonce renderer (THREE.WebGLRenderer. #js {"antialias" true}))
+(defonce light (do
+                 (let [light (THREE.DirectionalLight. 0x0000ff 1)]
+                   (.set (.-position light) 0.5 -1 0)
+                   (.add scene light))))
 
 (.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]}
+(defonce model (atom {:attractor {:id "attractor" :pos [0 0]}
                       :balls     (for [n (range 1 10)]
                                    {:id n :pos [(* n 0.4) 0] :velocity [0 0.3] :acceleration [0 0]})}))
 

      accelerate-balls
      move-balls))


(def geometry (THREE.BoxGeometry. 0.2 0.3 0.1))
(def material (THREE.MeshBasicMaterial. #js {"color" 0xffffff "wireframe" true}))

(defn add-items-to-scene [scene model]
  (doseq [ball (:balls model)]
    (prn (str  "Adding: " ball))
    (let [ball-mesh (THREE.Mesh.
                      geometry
                      material)]

(ns threedee.core
  (:require [cljs.pprint :refer [pprint]]
            [cljsjs.three :as THREE]
            [threedee.vectors :as v]))

