ARVideoKit icon indicating copy to clipboard operation
ARVideoKit copied to clipboard

Plane detection is shown blank

Open Anu150030170 opened this issue 3 years ago • 2 comments

After recording the sceneview it shows blank plane. IMG_8369 .. Can you please tell me solution for this...

Anu150030170 avatar Dec 16 '20 08:12 Anu150030170

How are you adding the planes to the scene graph?

digitallysavvy avatar Dec 17 '20 21:12 digitallysavvy

It is something similar to this I did with reference https://developer.apple.com/documentation/arkit/world_tracking/tracking_and_visualizing_planes

        func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {
       guard let planeAnchor = anchor as? ARPlaneAnchor, planeAnchor.alignment == .horizontal else { return }
        let grid = Grid(anchor: planeAnchor,textureImageName:floorTextureImageName)
        self.grids.append(grid)
        node.name = "Floornode parent"
        node.addChildNode(grid)
        }

In class Grid : SCNNode we perform this in init method --

    planeGeometry = SCNPlane(width: CGFloat(anchor.width), height: CGFloat(anchor.length))
    let material = SCNMaterial()
    material.diffuse.contents = UIImage(named: textureImageName ?? "")
    planeGeometry?.materials = [material]
    let planeNode = SCNNode(geometry: self.planeGeometry)
    planeNode.position = SCNVector3Make(anchor.center.x, 0, anchor.center.z);
    planeNode.transform = SCNMatrix4MakeRotation(Float(-Double.pi / 2.0), 1.0, 0.0, 0.0);
    planeNode.name = "FloorNode"
    addChildNode(planeNode)

I stop detection of horizontal plane after detecting required area using self.configuration.planeDetection = []

Later in my app I add a button for recording which when tapped records the sceneview using this framework arvideokit..

Anu150030170 avatar Dec 21 '20 05:12 Anu150030170