Created
March 6, 2019 14:04
-
-
Save rajajawahar/1901ed22f1d70ce508f3d9deef3de649 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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