         
         // Create a session configuration
         let configuration = ARWorldTrackingSessionConfiguration()
-        configuration.planeDetection = .horizontal
-        
+//        configuration.planeDetection = .horizontal
+
         // Run the view's session
         sceneView.session.run(configuration)
     }

        // Release any cached data, images, etc that aren't in use.
    }

//    func updateText() {
//        guard let screenCenter = screenCenter else { return }
//
//        let (worldPos, planeAnchor, _) = worldPositionFromScreenPosition(screenCenter, objectPos: textNode?.position)
//        if let worldPos = worldPos {
//            textNode?.position = worldPos
//        }
//    }

//    func worldPositionFromScreenPosition(_ position: CGPoint,
//                                         objectPos: SCNVector3?,
//                                         infinitePlane: Bool = false) -> (position: SCNVector3?, planeAnchor: ARPlaneAnchor?, hitAPlane: Bool) {
//
//        // -------------------------------------------------------------------------------
//        // 1. Always do a hit test against exisiting plane anchors first.
//        //    (If any such anchors exist & only within their extents.)
//
//        let planeHitTestResults = sceneView.hitTest(position, types: .existingPlaneUsingExtent)
//        if let result = planeHitTestResults.first {
//
//            let planeHitTestPosition = SCNVector3.positionFromTransform(result.worldTransform)
//            let planeAnchor = result.anchor
//
//            // Return immediately - this is the best possible outcome.
//            return (planeHitTestPosition, planeAnchor as? ARPlaneAnchor, true)
//        }
//
//        // -------------------------------------------------------------------------------
//        // 2. Collect more information about the environment by hit testing against
//        //    the feature point cloud, but do not return the result yet.
//
//        var featureHitTestPosition: SCNVector3?
//        var highQualityFeatureHitTestResult = false
//
//        let highQualityfeatureHitTestResults = sceneView.hitTestWithFeatures(position, coneOpeningAngleInDegrees: 18, minDistance: 0.2, maxDistance: 2.0)
//
//        if !highQualityfeatureHitTestResults.isEmpty {
//            let result = highQualityfeatureHitTestResults[0]
//            featureHitTestPosition = result.position
//            highQualityFeatureHitTestResult = true
//        }
//
//        // -------------------------------------------------------------------------------
//        // 3. If desired or necessary (no good feature hit test result): Hit test
//        //    against an infinite, horizontal plane (ignoring the real world).
//
//        if (infinitePlane) || !highQualityFeatureHitTestResult {
//
//            let pointOnPlane = objectPos ?? SCNVector3Zero
//
//            let pointOnInfinitePlane = sceneView.hitTestWithInfiniteHorizontalPlane(position, pointOnPlane)
//            if pointOnInfinitePlane != nil {
//                return (pointOnInfinitePlane, nil, true)
//            }
//        }
//
//        // -------------------------------------------------------------------------------
//        // 4. If available, return the result of the hit test against high quality
//        //    features if the hit tests against infinite planes were skipped or no
//        //    infinite plane was hit.
//
//        if highQualityFeatureHitTestResult {
//            return (featureHitTestPosition, nil, false)
//        }
//
//        // -------------------------------------------------------------------------------
//        // 5. As a last resort, perform a second, unfiltered hit test against features.
//        //    If there are no features in the scene, the result returned here will be nil.
//
//        let unfilteredFeatureHitTestResults = sceneView.hitTestWithFeatures(position)
//        if !unfilteredFeatureHitTestResults.isEmpty {
//            let result = unfilteredFeatureHitTestResults[0]
//            return (result.position, nil, false)
//        }
//
//        return (nil, nil, false)
//    }

    // MARK: - coreML vision logic
    func setupVision() {

            // add 3d text
            if let firstPrediction = classifications.first {
                if firstPrediction.confidence > 0.1 {
//                    self.addText(text: firstPrediction.identifier)
                    if let t = firstPrediction.identifier.split(separator: ",").first {
                        self.text = String(t)
                    }
                }
            }

