 
 
 (defn mknode
+  "It takes a list or an undefined number of geometries and put them into
+   a single node. Materials are preserverd."
   [& objs]
-  (let [new-node (Node. "node")]
-    (doseq [geom objs] (.attachChild new-node geom))
+  (let [flattened-args (flatten objs)
+	new-node (Node. "node")]
+    (doseq [geom flattened-args] (.attachChild new-node geom))
     new-node))
 
 

      (.setMaterial (default-material)))))


(defhigh mkpol
  "Mk polyedra."
  [vertices dim]

  (cond-match

   [0 dim]
   (println "TODO")

   [1 dim]
   (let [vl1 (butlast vertices)
	 vl2 (next vertices)]
     (struct2 (map #(line %1 %2) vl1 vl2)))
   

   [? dim] (println "TODO")))


(defn load-obj
  "Load an .obj file and makes it available for rendering.
   Remember to load a single model with this function. For

  [geom1 geom2]
  (let [out-mesh (Mesh.)]
    (GeometryBatchFactory/mergeGeometries [geom1 geom2] out-mesh)
    (doto (Geometry. "structured" out-mesh)
      (.setMaterial (default-material)))))

