Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane detection is shown blank #125

Open
Anu150030170 opened this issue Dec 16, 2020 · 2 comments
Open

Plane detection is shown blank #125

Anu150030170 opened this issue Dec 16, 2020 · 2 comments

Comments

@Anu150030170
Copy link

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

@digitallysavvy
Copy link

How are you adding the planes to the scene graph?

@Anu150030170
Copy link
Author

Anu150030170 commented Dec 21, 2020

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants