Created
December 7, 2018 10:38
-
-
Save pavan4/03aa4a3dd2903435a93bc529076d8a08 to your computer and use it in GitHub Desktop.
Attaching a node to an anchor
This file contains hidden or 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 nodeForSmartAnchor(_ anchor: ARSmartAnchor) -> SCNNode { | |
| let node = SCNNode() | |
| if anchor.label == "laptop" { | |
| createSCNNodeFromTextureURL(url: URL(string:"https://media.giphy.com/media/3o7aCSxsasvg9LjJDy/giphy.gif")!) { asset in | |
| if let asset = asset { | |
| asset.position = SCNVector3(0.0,0.15,0.03) | |
| asset.scale = SCNVector3(0.3,0.3,0.3) | |
| node.addChildNode(asset) | |
| } | |
| } | |
| } | |
| return node | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment