In almost all ARKit tutorials, it seems like we always use ARPlane for the floor.
let planeGeometry = SCNPlane(width:CGFloat(planeAnchor.extent.x), height:CGFloat(planeAnchor.extent.z))
let planeNode = SCNNode(geometry:planeGeometry)
planeNode.position = SCNVector3(x:planeAnchor.center.x, y:0, z:planeAnchor.center.y)
planeNode.transform = SCNMatrix4MakeRotation(-Float.pi / 2, 1.0, 0, 0)
What if you need an endless plane (to cast shadows)? I tried SCNFloor, and the result was strange - the floor was hanging in the air:
let planeGeometry = SCNFloor()
let planeNode = SCNNode(geometry:planeGeometry)
planeNode.position = SCNVector3(planeAnchor.center.x, 0, planeAnchor.center.z)
I did a google search, and the only result I came across was (which also doesn't work): https://github.com/arirawr/ARKit-FloorIsLava/blob/master/FloorIsLava/ViewController.swift
Does SCNFloor () work in ARKit? If not, what can I do to create a large plane?
source
share