     ]
     
     var depthStencilStateMap: Spectra.DepthStencilStateMap = [:]
-    var nodeMap: Spectra.SceneNodeMap = [:]
+    
+    let cubeKey = "spectra_cube"
+    var nodeMap: Spectra.SceneNodeMap
     
     override func viewDidLoad() {
         super.viewDidLoad()
         loadPipelineStateMap()
         loadDepthStencilMap()
+        
+        scene = Spectra.Scene()
+        setupObjects()
         setupScene()
     }
     

import MetalKit
import Spectra
import simd

class CubeViewController: MetalViewController {
    
    @IBOutlet weak var spectraView: Spectra.BaseView! //TODO: weak?
    
    var scene: Spectra.Scene?
    
    // i wish i could more strongly constrain the keys for these maps

        depthStencilStateMap["default"] = spectraView.device?.newDepthStencilStateWithDescriptor(depthStateDesc)
    }
    
    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 cube = try! xml["root"].withAttr("id", cubeKey)
        
        // attach position, color and vertex data to nodes
        
    }
    
    func setupCube(cubeKey: String, xmlCube: XMLElement) {
        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()
        nodeMap[cubeKey] = cubeNode
        //nodeMap[cubeKey] =
    }
    
    func setupScene() {
        scene!.pipelineStateMap = pipelineStateMap

    }
    
}