         //create encodable inputs for camera/etc
     }
     
+    func setupSceneGraph() {
+        let bundle = NSBundle(forClass: CubeViewController.self)
+        let path = bundle.pathForResource("Cube", ofType: "xml")
+        
+        let data = NSData(contentsOfFile: path!)
+        let sceneGraph = SceneGraph(xmlData: data!)
+        
+        scene!.sceneGraph = sceneGraph
+    }
+    
+    func setupNodeGeneratorMap() {
+        scene!.nodeGeneratorMap["cube"] = Spectra.CubeGenerator()
+    }
     func setupObjects() {
         // parse Cube.XML
-        let bundle = NSBundle(forClass: CubeViewController.self)
-        let path = bundle.pathForResource("Cube", ofType: "xml")
-        let data = NSData(contentsOfFile: path!)
-        let xml = SWXMLHash.parse(data!)
         
         let cubeXml = try! xml["root"]["mesh"].withAttr("id", cubeKey)
         setupCube(cubeKey, xml: cubeXml)

    func setupCube(cubeKey: String, xml: XMLIndexer) {
        let cubeNode = Spectra.Node()
        let cubeGen = Spectra.CubeGenerator()
        cubeNode.data["position"] = cubeGen.getVertices()
        cubeNode.data["texcoords"] = cubeGen.getTexCoords()
        cubeNode.data["colorcoords"] = cubeGen.getColorCoords()
        cubeNode.dataMaps["triangle_vertex"] = cubeGen.getTriangleVertexMap()
        scene!.nodeMap[cubeKey] = cubeNode
        //nodeMap[cubeKey] =
    }

        
        scene = Spectra.Scene()
        setupPerspective()
        setupSceneGraph()
        setupObjects()
        setupScene()
    }
