         resetPointIndex = true
     }
 
+    func panHandler(recogniser: UIPanGestureRecognizer)
+    {
+        switch recogniser.state
+        {
+        case .Began:
+            panning = true
+            panStartAngle = angle
+        case .Changed:
+            angle = panStartAngle + Float(CGFloat(M_PI) * recogniser.translationInView(self).x / width)
+        default:
+            panning = false
+        }
+    }
+    
     func pinchHandler(recogniser: UIPinchGestureRecognizer)
     {
         switch recogniser.state

    private var frameStartTime: CFAbsoluteTime!
    private var frameNumber = 0
    
    private var width: CGFloat
    private let centerBuffer: MTLBuffer
    

        
        let pinch = UIPinchGestureRecognizer(target: self, action: #selector(pinchHandler))
        addGestureRecognizer(pinch)
        
        let pan = UIPanGestureRecognizer(target: self, action: #selector(panHandler))
        addGestureRecognizer(pan)
        
        addSubview(segmentedControl)
        segmentedControl.addTarget(
