Skip to content

Instantly share code, notes, and snippets.

@rajajawahar
Created March 6, 2019 14:04
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 rajajawahar/1901ed22f1d70ce508f3d9deef3de649 to your computer and use it in GitHub Desktop.
Save rajajawahar/1901ed22f1d70ce508f3d9deef3de649 to your computer and use it in GitHub Desktop.
func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? {
let node = SCNNode()
if let imageAnchor = anchor as? ARImageAnchor{
let plane = SCNPlane(width: imageAnchor.referenceImage.physicalSize.width, height: imageAnchor.referenceImage.physicalSize.height)
plane.firstMaterial?.diffuse.contents = UIColor(cgColor: CIColor.white as! CGColor)
let planeNode = SCNNode(geometry: plane)
planeNode.eulerAngles.x = - .pi/2
node.addChildNode(planeNode)
}
return node
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment