HomeiOS Developmentios - ARKit and SwiftUI - Efficiency Overlay Subject

ios – ARKit and SwiftUI – Efficiency Overlay Subject


I am making an attempt to get began with ARKit in SwiftUI. However I am unable to show off this textual content that seems over the View. Does anybody know what the title of this textual content is and the way I can toggle it off? It does not seem like a part of debug choices and is a separate statistical output from SceneView’s showStatistics boolean.

enter image description here

import SwiftUI
import ARKit

struct ARKitView: UIViewRepresentable {
    let session = ARSession()
    let sceneView = ARSCNView()

    func makeUIView(context: Context) -> ARSCNView {
        sceneView.delegate = context.coordinator
        sceneView.showsStatistics = false
        sceneView.debugOptions = []
        sceneView.session = session

        // Create a dice and add it to the scene
        let dice = SCNBox(width: 0.1, top: 0.1, size: 0.1, chamferRadius: 0)
        let cubeNode = SCNNode(geometry: dice)
        cubeNode.place = SCNVector3(0, 0, -0.5)
        // Apply a 45-degree rotation across the Y-axis (in radians)
         let angle = 45.0 * .pi / 180.0
         cubeNode.eulerAngles = SCNVector3(0, angle, 0)
        sceneView.scene.rootNode.addChildNode(cubeNode)
     
      return sceneView
    }
    
    func updateUIView(_ uiView: ARSCNView, context: Context) {
        // Replace your AR scene right here
    }
    
    func makeCoordinator() -> Coordinator {
        Coordinator(self)
    }
    
    class Coordinator: NSObject, ARSCNViewDelegate {
        var father or mother: ARKitView
        
        init(_ father or mother: ARKitView) {
            self.father or mother = father or mother
          
        }
        
        func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) {

           if let currentFrame = father or mother.sceneView.session.currentFrame {
               // Course of the pixel knowledge right here
            }
        }
        

    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments