Skip to content

Instantly share code, notes, and snippets.

@Utsira
Last active June 15, 2018 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Utsira/90e913a30f8e1a6bf90839a312e0f487 to your computer and use it in GitHub Desktop.
Save Utsira/90e913a30f8e1a6bf90839a312e0f487 to your computer and use it in GitHub Desktop.
func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? {
guard let plane = anchor as? ARPlaneAnchor,
let device = renderer.device,
let geometry = ARSCNPlaneGeometry(device: device)
else { return nil }
geometry.update(from: plane.geometry)
let maskMaterial = SCNMaterial()
maskMaterial.colorBufferWriteMask = []
geometry.materials = [maskMaterial]
let node = SCNNode(geometry: geometry)
node.renderingOrder = -1
return node
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment