Created
May 21, 2018 20:01
-
-
Save azamsharp/283dbbec48a8dad129e35ffa02e56e62 to your computer and use it in GitHub Desktop.
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
@objc func addBlock() { | |
let grAnchor = try? self.gSession.resolveCloudAnchor(withIdentifier: self.cloudIdentifier) | |
if let cloudAnchor = grAnchor { | |
let box = SCNBox(width: 0.1, height: 0.1, length: 0.1, chamferRadius: 0) | |
let node = SCNNode(geometry: box) | |
node.position = SCNVector3(cloudAnchor.transform.columns.3.x, cloudAnchor.transform.columns.3.y, cloudAnchor.transform.columns.3.z) | |
self.sceneView.scene.rootNode.addChildNode(node) | |
let cloudAnchorRef = self.rootRef.child("cloud-anchors") | |
cloudAnchorRef.setValue(["cloudIdentifier":self.cloudIdentifier,"hex":"#FFFFFF"]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment